Deploying iMIS using command line arguments

Has anyone deployed iMIS15.0.3 by setting up some sort of package with command line arguments?
I have a client who would like to use this method, as they have over 80 workstations that they will need to install it on. The pre-configured installer is a bit quicker then a normal install, but still takes some time.

Any ideas?

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

10.6 installer, maybe useful?

This may or may not be of any use, it's our 10.6 installer. Maybe you can milk it for spare parts or ideas.

Basically it uninstalls iMIS (which was a bit hit and miss for a couple of machines that had iMIS installed in 10.4 timeframe, reg hacking required on those machines), and then installs EVERYTHING needed (.Net, IMIS base, iMIS patch, our customised framework, various utilities, ODBC, Test version and so on).

The installation relies on "installer response files" which you can record, and then replay (try setup /? to find out what the 15 installers support). The IMIS 10.6 installer wasn't written properly to allow the serial # to be entered via script, so I ended up copying that to the clipboard.

Possibly also of note is the file used to track which version of the customised framework is installed (it's the first variable set in the second file).

Naturally I'm available for consulting work, if you are in reach of Sydney.

 

 

Two separate files:

InstalliMISClient.cmd and UpdateIMISClient.cmd

There are a few other files it uses, such as .reg files containing ODBC details and the actual installers

 

@ECHO off
echo ###########################################################################
echo ### iMIS 10.6 Installation
echo ###########################################################################
echo ###
echo ### Generally this is for Workstations and Citrix only, not servers
echo ###
echo ### Press Ctrl+C to bail out
echo ###
pause

REM check for .NET2.0
if not exist "%WINDIR%\Microsoft.NET\Framework\v2.0.50727" (
echo ###########################################################################
echo ### Installing .Net 2.0
echo ###########################################################################
"g:\public\installs\microsoft\dotnet framework 2.0\dotnetfx.exe" /q
"g:\public\installs\microsoft\dotnet framework 2.0\netfx20sp1_x86.exe" /q /norestart
)

echo ###########################################################################
echo ### Looking for iMIS10.5
echo ###########################################################################

reg query HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{3F472C06-2197-4AD0-86A4-2E7EDC99532C} /v DisplayVersion
if %errorlevel% EQU 0 call :Uninstall105

echo ###########################################################################
echo ### installing iMIS 10.6.30.07 (be patient, this takes several minutes)
echo ###
echo ### Serial # copied to clipboard. Paste when prompted.
echo ### Use cough for username and company
echo ###########################################################################

pushd installs\iMIS10.6.30.07

REM Copy serial number to clipboard.
echo THE_SECRET_SERIAL_NUMBER| clip.exe

copy imis10.6.30.07.iss %temp% > nul
setup.exe /s /f1"%temp%\imis10.6.30.07.iss"

if not exist "%PROGRAMFILES%\iMIS10\imisloc.df1" (
  echo ### ERROR! iMIS did not install!
  pause
  popd
  goto :eof
)

popd

echo.
echo ###########################################################################
echo ### installing iMIS 10.6.30.17 Update (takes a minute)
echo ###########################################################################

pushd installs\iMIS10.6.30.17

copy imis10.6.30.17.iss %temp% > nul
iMIS1063017_ClientUpdate.exe /s /f1"%temp%\imis10.6.30.17.iss"

popd

echo.
echo ###########################################################################
echo ### installing [ORGANISATION] iMIS Framework.
echo ###########################################################################
call UpdateiMISClient.cmd
echo.

echo ###########################################################################
echo ### FINISHED.
echo ###########################################################################

goto :eof

:Uninstall105
echo ###########################################################################
echo ### Uninstalling iMIS 10.5 (be patient, this takes several minutes)
echo ###########################################################################
copy uninstall\UninstallImis10.5.iss %temp%
Uninstall\setup10.5.exe /s /f1"%temp%\UninstallImis10.5.iss"
del %PROGRAMFILES%\imis10\version. 2> nul
 

 

Second File:

 

@echo off
REM #####################################################################
REM #### UPDATE THIS WHEN THERE ARE CHANGES TO THE FRAMEWORK!!!!!! ######
REM #####################################################################
set UpdateVersion=Version.10.6.Prod.7

REM ### update for new server location
set SOURCEPATH=\\CONFIDENTIAL\public\Installs\iMIS10.6
echo %SOURCEPATH%
set iMISProd=iMIS10
set iMISTEST=iMISTest

echo Validating source path
if not exist %SOURCEPATH% (
  echo Installation directory not found
  echo Installation directory not found %SOURCEPATH%
  pause
  goto :eof
)

echo Validating existing imis installation
if not exist "%ProgramFiles%\%iMISProd%" (
  echo iMIS is not installed on this computer.
  pause
  goto :eof
)

echo Writing timestamp
REM ### Write timestamp file (so we don't install this more than we need to)
if exist "%ProgramFiles%\%IMISProd%\%UpdateVersion%" (
  echo.
  echo #################################################################
  echo Already installed %ProgramFiles%\%IMISProd%\%UpdateVersion%
  echo.
  echo Installation terminated.
  echo.
  pause
  goto :eof
) else (
  date /t > "%ProgramFiles%\%IMISProd%\%UpdateVersion%" && time /t >> "%ProgramFiles%\%IMISProd%\%UpdateVersion%"
)

echo INSTALL %UpdateVersion%

REM ### Copy latest files to c:\program files\iMIS10
call :CopyFrameWork %iMISProd%

echo.
echo ###########################################################################
echo ### installing iMISTest
echo ###########################################################################
mkdir "%PROGRAMFILES%\%imistest%" 2> nul
xcopy "%PROGRAMFILES%\%imisprod%" "%PROGRAMFILES%\%imistest%" /s /e /h /y > nul
echo A
REM change to test
copy /y %SOURCEPATH%\installs\imistest\imisloc.df1 "%PROGRAMFILES%\%imistest%"
echo B

copy /y "%PROGRAMFILES%\%imistest%\framework\HiRes\Main\navstyle_TEST.css" "%PROGRAMFILES%\%imistest%\framework\HiRes\Main\navstyle.css"
echo C

copy /y "%PROGRAMFILES%\%imistest%\framework\Images\logo_left_bg_TEST.gif" "%PROGRAMFILES%\%imistest%\framework\images\logo_left_bg.gif"

echo D
REM Create menu item
copy %SOURCEPATH%\installs\shortcuts\imis*.lnk  "%ALLUSERSPROFILE%\Start Menu\Programs\iMIS10\"
echo E

REM Desktop links
del "%ALLUSERSPROFILE%\desktop\imis.lnk" 2> nul
del "%ALLUSERSPROFILE%\desktop\imistest.lnk" 2> nul

copy "%SOURCEPATH%\installs\shortcuts\imis.ico" "%PROGRAMFILES%\imis10"
copy "%SOURCEPATH%\installs\shortcuts\imistest.ico" "%PROGRAMFILES%\%imistest%"

copy "%SOURCEPATH%\installs\shortcuts\*.lnk" "%ALLUSERSPROFILE%\Desktop"

REM Quicklinks
del "%USERPROFILE%\Application Data\Microsoft\Internet Explorer\Quick Launch\imis*.lnk" 2> nul
copy "%SOURCEPATH%\installs\shortcuts\*.lnk" "%USERPROFILE%\Application Data\Microsoft\Internet Explorer\Quick Launch"

REM ### Install Xtender
echo INSTALLING iMIS Xtender
call :LocalSetup "%SOURCEPATH%\installs\csa" CSA_2.01.0001.msi
rmdir /s /q "%ALLUSERSPROFILE%\Start Menu\Programs\Customer Service Alerts for iMIS" 2> nul

REM ### install barcode
echo INSTALLING BARCODE
%SOURCEPATH%\installs\barcode\barcode.exe /i

REM ### install user field library
echo INSTALLING Crystal Reports Barcode UFL (user field library)
call :LocalSetup "%SOURCEPATH%\installs\barcode" ufl.msi

REM ### Upgrade fonts no matter what.
echo INSTALLING Barcode fonts
copy /y %SOURCEPATH%\installs\barcode\*.ttf %WINDIR%\fonts

REM ### Install iMIS Utilities by iMISSearch.exe (Duplicate Utility + Order/Event search) and ExecuteStoredProcedure.exe
echo INSTALLING iMISSearch, Duplicate Utility and Execute Stored Procedure
call :LocalSetup "%SOURCEPATH%\installs\imissearch" setup.msi

REM ### launchCmd.ocx used by xtender
echo REGISTERING launchcmd.ocx
xcopy "%SOURCEPATH%\installs\Close Events\LaunchCmd.ocx" "%WINDIR%\System32\" /s /e /h /y
regsvr32 /s "%WINDIR%\system32\launchCmd.ocx"

regsvr32 /s "%WINDIR%\system32\ASIActivityImporter.ocx"
regsvr32 /s "%WINDIR%\system32\ASIDBUpgrade.dll"
regsvr32 /s "%WINDIR%\system32\ASIDBUtil.dll"
regsvr32 /s "%WINDIR%\system32\ASIDesktop.ocx"
regsvr32 /s "%WINDIR%\system32\ASIExecScreen.ocx"
regsvr32 /s "%WINDIR%\system32\ASIFunction.dll"
regsvr32 /s "%WINDIR%\system32\ASIJobMgr.ocx"
regsvr32 /s "%WINDIR%\system32\ASILicSec.ocx"
regsvr32 /s "%WINDIR%\system32\ASIPayflowPro.ocx"
regsvr32 /s "%WINDIR%\system32\ASITabOrder.ocx"
regsvr32 /s "%WINDIR%\system32\ASIWordInt.ocx"
regsvr32 /s "%WINDIR%\system32\ASIUtil.dll"

REM this is the one line bat file that comes with imis 10.6
%WINDIR%\Microsoft.NET\Framework\v2.0.50727\regasm %WINDIR%\assembly\GAC_MSIL\Payflow_dotNET\4.3.0.0__14aa1e8d77f2a97c\payflow_dotnet.dll

echo ### Creating System DSNs
regedit /s installs\ODBC\datasources.reg
regedit /s installs\ODBC\imis.reg
regedit /s installs\ODBC\imistest.reg

echo.
echo.
echo FINISHED SUCCESSFULLY
pause
goto :eof

:CopyFrameWork
REM ### copies the imis html framework to the current directory

if exist "%ProgramFiles%\%1\" (
  echo.
  echo.
  echo ##############################################
  echo UPDATING FRAMEWORK %ProgramFiles%\%1
  echo ##############################################
  copy /y %SOURCEPATH%\10.6Framework\xtender.ini "%ProgramFiles%\%1\
  xcopy "%SOURCEPATH%\10.6Framework\HiRes\*.*" "%ProgramFiles%\%1\framework\hires\" /s /e /h /y
  xcopy "%SOURCEPATH%\10.6Framework\images\*.*" "%ProgramFiles%\%1\framework\images\" /s /e /h /y
  echo.
  echo INSTALLLING Close Events to "%ProgramFiles%\%1"
  copy /y "%SOURCEPATH%\installs\Close Events\Events.exe" "%ProgramFiles%\%1\"
  echo.
  echo.
) else (
  echo Directory %ProgramFiles%\%1\ does not exist.
)

goto :eof

:LocalSetup
REM %1 path to installer
REM %2 name of installer

if not exist "%1\%2" (
  echo ERROR could not find "%2\%1"
)

REM ### copy local to avoid permission issues
copy /y "%1\%2" "%TEMP%"
%WINDIR%\system32\msiexec.exe /passive /i "%TEMP%\%2"

del %TEMP%\%2
goto :eof

How to modify the imisloc.df1 file?

Thanks for the comments.

Here is the latest update:

"Some progress has been made with the pre-made package that is downloadable from the iMIS server. It appears to be possible to use that setup.exe within the Altiris package. (Network Services have successfully installed the client using this .exe via an Altiris package, but have yet to package the remaining steps - patch, EFT & legacy ODBC update)"

He has been able to setup a package and deploy it. But the default Server configuration is missing (ie: it has to be added in manually via the set-host-location option).

It's not really practical to expect all of our users to add this in manually. Is there anyway to set this via the command line? (we have been able to figure out how to add in new options to the select list - via the registry), but the existing default server name is stored in the imisloc.df1 file.

Can this value be updated/set via a command line option?"

this might help

Again, this is for 10.6, I'm not familiar with 15, but in 10.6 the host location is stored in the imisloc.df1 file in the %PROGRAMFILES%\IMIS directory. I expect it's similar.

To change host location in 10.6: Cancel from the login screen. Select Logon | Set Host Location. Press Ctrl+E (seriously), choose the appropriate DSN.

In the installer code above this is copied when the test directory is created -- we have two versions, one for PROD and one for TEST. (all users have access to test, we encourage them to play around there rather than mess up production).

Edit: hmmm, perhaps I should read things first. I'm not familiar with altris, I'd just copy the imisloc.df1 file after iMIS is installed. If you want to be proper you can package the copy into its own MSI. You can edit MSIs but unless you're really keen I wouldn't bother with that route.