hits counter

Products - Silent Switch Finder Examples - Software with a 90 days unlimited trial with all features installed

Go to content

Products - Silent Switch Finder Examples

Paste the syntax controlled vbScript lines into your ComputerJob with CTRL+V:

Examples:
  • The CapaInstaller vbScript lines about MSI, Inno Setup and InstallShield
  • Logfiles when running SilentSwitchFinder
  • The settings ini file you can use to customize the features in SilentSwitchFinder.
 

The CapaInstaller vbScript lines about MSI:


 ' ----------> This is a Microsoft MSI installer. CAPAINSTALLER - I N S T A L L <----------
 ' WARNING: If changes are needed in this file, please contact  with an example and an installer file

Function Install()
 ' -------------------------> OPTION: You DO   N O T   NEED to add info to these variables below:
 ' sTransFormFile --> OPTION: Did the vendor or you create an MST transform file to add updates to the sInstFile
 ' Command-line switches and errorlevel codes: http://www.tryware.dk/support/installersyntax_msi.html

                        ' --> OPTION: Maybe add the name of the MST transform file without \
 Dim sTransFormFile     : sTransFormFile = ".MST"

                        ' ---> INFO: These variables are used again in other variables:
 Dim sError             : sError = "The job is cancelled, because you forgot to change the "
 Dim sInfoErrorInst     : sInfoErrorInst = ", used in the used in sInstFile variable."
                        ' ---> INFO: The above variables are used again in other variables below:

 Dim sArgument          : sArgument = " /qn "
 Dim sErrorMst          : sErrorMst = sError & "sProgramName variable: " & sProgramName & sInfoErrorInst
 Dim sGuid
 Dim sInstFile          : sInstFile = gsPackageRoot & "\Kit\Test_MSI_HandyBackup730.msi"
 Dim sMsiLogDir         : sMsiLogDir = gsLogDir & "\Msilogs"
 Dim sMsiLogFile        : sMsiLogFile = sMsiLogDir & "\Appl_Install_" & gsJobname & ".log"
 Dim sMsiOption         : sMsiOption = "REBOOT=REALLYSUPPRESS ALLUSERS=2"
 Dim sProgram           : sProgram = gsWindowsdir & "\System32\msiexec.exe"
 Dim sThisFunctionName  : sThisFunctionName = "Function Install"
 Dim sTransForm         : sTransForm = ""
 Dim bMustExist         : bMustExist = False
                        ' iStyle (11 different, among others: 0=Hide, 1=Restore, 2, Minimized, 3=Maximized)
 Dim iStyle             : iStyle = 0
 Dim bCheckExistence    : bCheckExistence = True
 Dim bStatus            : bStatus = True
 Dim bWait              : bWait = True

   If bStatus Then bStatus = File_ExistDir(sMsiLogDir, bMustExist)
   If bStatus And NOT gbValue Then bStatus = File_CreateDirectory(sMsiLogDir)
   If bStatus Then bStatus = MSI_GetPackageGUID(sInstFile)
   If bStatus Then sGuid = gsValue                        ' This is the current msi-file, maybe use sGuid from an earlier version!
   If bStatus Then bStatus = MSI_GetPackageStatusByGuid(sGuid)
   If bStatus And (uCase(gsValue) = "THE PACKAGE IS INSTALLED.") Then
       ' /fmp is not used, because some vendors demands to UnInstall before a new Install, and some vendors might not recreate all
       ' needed regkeys and files, like 
e.g. shortcuts in startmenu or desktop.
       bStatus = Uninstall(sGuid)
   End if
   If bStatus Then bStatus = File_ExistFile(sInstFile, bMustExist)
   If bStatus And gbValue Then
       If bStatus And sTransFormFile <> ".MST" Then
           bStatus = File_ExistDir(gsPackageRoot & "\Kit\" & sTransFormFile, bMustExist)
           If bStatus And gbValue Then
                   sTransForm = " TRANSFORMS=" & """" & gsPackageRoot & "\Kit\" & sTransFormFile & """"
               Else
                   bStatus = Job_ErrorHandling(sThisFunctionName, "----- " & sErrorMst & " -----", 0)
           End if
       End if
       If bStatus Then bStatus = Shell_Execute(sProgram, "/i " & """" & sInstFile & """" & " /L" & """" & "*" & """" & """" &
                                           sMsiLogFile & """" & sArgument & sMsiOption & sTransForm, bWait, iStyle, bCheckExistence)
       If bStatus And (giErrorLevel > 0) And (giErrorLevel <> 3010) Then bStatus = Appl_SetMSIError(giErrorLevel)
       If bStatus And (giErrorLevel = 1618) Then bStatus = CDM_JobRetryLater("----> Another MSI installation is running - this
                                                                                            job tries again later! (Job cancelled)")
       If bStatus And (giErrorLevel = 3010) Then bStatus = Job_WriteLog(sThisFunctionName, "-----> Install requested reboot
                                                                                                             <-----", bStatus, True)
   End If

   Install = bStatus
End Function

 '   ----------> This is a Microsoft MSI installer. CAPAINSTALLER - U N I N S T A L L <----------
Function UnInstall()
 ' Command-line switches and errorlevel codes: http://www.tryware.dk/support/installersyntax_msi.html

 Dim sArgument          : sArgument = " /qn "
 Dim sGuid
 Dim sInstFile          : sInstFile = gsPackageRoot & "\Kit\Test_MSI_HandyBackup730.msi"
 Dim sMsiLogDir         : sMsiLogDir = gsLogDir & "\Msilogs\"
 Dim sMsiLogFile        : sMsiLogFile = sMsiLogDir & "\Appl_UnInstall_" & gsJobname & ".log"
 Dim sMsiOption         : sMsiOption = "REBOOT=REALLYSUPPRESS ALLUSERS=2"
 Dim sProgram           : sProgram = gsWindowsdir & "\System32\msiexec.exe"
 Dim sThisFunctionName  : sThisFunctionName = "Function UnInstall"
 Dim bMustExist         : bMustExist = False
                        ' iStyle (11 different, among others: 0=Hide, 1=Restore, 2, Minimized, 3=Maximized)
 Dim iStyle             : iStyle = 0
 Dim bCheckExistence    : bCheckExistence = True
 Dim bStatus            : bStatus = True
 Dim bWait              : bWait = True

   If bStatus Then bStatus = File_ExistDir(sMsiLogDir, bMustExist)
   If bStatus And Not(gbValue) Then bStatus = File_CreateDirectory(sMsiLogDir)
   If bStatus Then bStatus = MSI_GetPackageGUID(sInstFile)
   If bStatus Then sGuid = gsValue
   If bStatus Then bStatus = MSI_GetPackageStatusByGuid(sGuid)
   If bStatus And (uCase(gsValue) = "THE PACKAGE IS INSTALLED.") Then
       If bStatus Then bStatus = Shell_Execute(sProgram, " /x" & sGuid & " /L" & """" & "*" & """" & """" & sMsiLogFile & """" &
                                                                sArgument & sMsiOption & 
sTransForm, bWait, iStyle, bCheckExistence)
       If bStatus And (giErrorLevel > 0) And (giErrorLevel <> 3010) Then bStatus = Appl_SetMSIError(giErrorLevel)
       If bStatus And (giErrorLevel = 1618) Then bStatus = CDM_JobRetryLater("--> Another MSI installation is running - this job
                                                                                                tries again later! (Job cancelled)")
       If bStatus And (giErrorLevel = 3010) Then bStatus = Job_WriteLog(sThisFunctionName, "--> UnInstall requested a reboot of
                                                                                                   the computer <--", bStatus, True)
   End If

   UnInstall = bStatus
End Function

The above scripts automatically creates a MSI errorlevel file using the /L switch to msiexec.exe

If you are using the CapaInstaller Package Creator, the MSI installer almost always works, but ...

If you are using my SilentSwitchFinder, the same is created, but there are added a lot of details and answers to questions you might have, and a link to all the
possible Msiexec switches and error codes.

The CapaInstaller vbScript lines about Inno Setup:


 ' ----------> This is an Inno Setup installer. CAPAINSTALLER - I N S T A L L <----------
 ' WARNING: If changes are needed in this file, please contact  with an example and an installer file

Function Install()
 ' Command-line switches and errorlevel codes: http://tryware.dk/support/installersyntax_innosetup.html

                        ' ---> INFO: These variables are used again in other variables:
 Dim sInstallLog        : sInstallLog = gsWorkstationPath & "Logs\Temp\Ins_" & gsJobName & ".log"
 Dim sSearchString
       
    : sSearchString = "Process exit code: 1603"
                        ' ---> INFO: The above variables are used again in other variables below:

 Dim sArgument          : sArgument = "/VERYSILENT /SUPPRESSMSGBOXES /NORESTART /SP- /CLOSEAPPLICATIONS"
 Dim sErrorLog          : sErrorLog = "The sInstallLog logfile contains " & Chr(34) & sSearchString & Chr(34) & vbCrLf
                sErrorLog = sErrorLog & "The reason might be, that the vendors installer could not install Microsoft " & vbCrLf
                sErrorLog = sErrorLog & "Visual C++ (vcredist_x86.exe), because CapaInstaller installed it earlier, maybe " & vbCrLf
                sErrorLog = sErrorLog & "including other versions, which you can find in the sub keys of" & vbCrLf
                sErrorLog = sErrorLog & "HKLM\SOFTWARE\CapaSystems\CapaInstaller\Statistics\" & vbCrLf
                sErrorLog = sErrorLog & "The solution is to contact the vendor about NOT to FORCE the vcredist_x86.exe " & vbCrLf 
                sErrorLog = sErrorLog & "installation. Otherwise you might get errors in other of your programs, if you " & vbCrLf                  
                sErrorLog = sErrorLog & "select to un-install the CapaInstaller version first to avoid the 1306 error."
 Dim sInfoJob           : sInfoJob = "Searched for " & Chr(34) & sSearchString & Chr(34) & " in " & sInstallLog & ", but " & vbCrLf
                          sInfoJob = sInfoJob & "did NOT find anything."
 Dim sInstallLogTemp    : sInstallLogTemp = gsWorkstationpath & "Logs\Temp\Ins_$ap$.Log"
 Dim sInstFile          : sInstFile = gsPackageRoot & "\Kit\Test_InnoSetup_Gimp.exe"
 Dim sThisFunctionName  : sThisFunctionName = "Function Install"
                        ' iStyle (11 different, among others:        0=Hide, 1=Restore, 2, Minimized, 3=Maximized)
 Dim iStyle             : iStyle = 0
 Dim bCheckExistence    : bCheckExistence = True
 Dim bForceDelete       : bForceDelete = True
 Dim bIgnoreCase        : bIgnoreCase = True
 Dim bMustExist         : bMustExist = False
 Dim bStatus            : bStatus = True
 Dim bWait              : bWait = True

   If bStatus Then bStatus = Shell_Execute(sInstFile, sArgument & " /LOG=" & Chr(34) & sInstallLogTemp & Chr(34), bWait, iStyle,
                                                                                                                    bCheckExistence)

   If bStatus Then bStatus = File_DelFile(sInstallLog, bForceDelete)
   If bStatus Then bStatus = File_RenameFile(sInstallLogTemp, sInstallLog)

   If bStatus Then bStatus = File_FindInFile(sInstallLog, sSearchString, bIgnoreCase, bMustExist)
   If bStatus And gbValue = True Then
           bStatus = Job_ErrorHandling(sThisFunctionName, "----- The job failed because: -----" & vbCrLf & sErrorLog, 0)
       Else
           bStatus = Job_WriteLog(sThisFunctionName, sInfoJob, bStatus, True)
   End if

       
Install = bStatus
End Function

 ' ----------> This is an InnoSetup installer. CAPAINSTALLER - U N I N S T A L L <----------
Function UnInstall()
 ' --------------------------> REQUIRED: You NEED to add info to these variables below:
 ' sProgramName ---> REQUIRED: The sub folder where the program is installed in gsProgramFiles
 ' --------------------------> OPTION: You DO   N O T   NEED to add info to these variables below:
 ' bForceError ------> OPTION: If you call UnInstall() from the CustomPreInstall() function, you might (or might not)
 '                             want to activate Job_ErrorHandling(), if the sUnInstFile does not exist.
 ' bReboot ----------> OPTION: Maybe the vendors UnInstall file requires a reboot
 ' Commandline switches and errorlevel codes: http://tryware.dk/support/installersyntax_innosetup.html

                        ' --> REQUIRED: sProgramName = Add the name of the programs sub folder name without \
 Dim sProgramName       : sProgramName = ""

                        ' --> OPTION: Maybe you want to activate Job_ErrorHandling()
 Dim bForceError        : bForceError = False

                        ' --> OPTION: Maybe the vendors UnInstall file requires a reboot
 Dim bReboot            : bReboot = False

                        ' ---> INFO: These variables are used again in other variables:
 Dim sError             : sError = "The job is cancelled, because you forgot to change the "
 Dim sInfo              : sInfo = "You forgot to change the "
 Dim sInfoErrorUnInst   : sInfoErrorUnInst = ", used in the used in sUnInstFile variable."
 Dim sProgramFolder     : sProgramFolder = gsProgramFiles & "\" & sProgramName
 Dim sUnInstFile        : sUnInstFile = sProgramFolder & "\UnIns000.exe"
                        ' ---> INFO: The above variables are used again in other variables below:

 Dim sArgument          : sArgument = "/SILENT"
 Dim sErrorPrg          : sErrorPrg = sError & "sProgramName variable: " & sProgramName & sInfoErrorUnInst
 Dim sErrorUnInst       : sErrorUnInst = sError & "sProgramName variable used in the sUnInstFile variable"
 Dim sInfoPrg           : sInfoPrg = sInfo & "sProgramName variable: " & sProgramName & sInfoErrorUnInst
 Dim sInfoUnInst        : sInfoUnInst = "Continue with the Install() function, because the " & sUnInstFile & " does not exist!"
 Dim sRebootMsg         : sRebootMsg = "Your computer is about to be rebooted, because the UnInstaller requested it!"
 Dim sThisFunctionName  : sThisFunctionName = "Function UnInstall"
                        ' iStyle (11 different, among others: 0=Hide, 1=Restore, 2, Minimized, 3=Maximized)
 Dim iStyle             : iStyle = 0
 Dim bCheckExistence    : bCheckExistence = True
 Dim bStatus            : bStatus = True
 Dim bWait              : bWait = True

   If bStatus Then bStatus = File_ExistFile(sUnInstFile, False)
   If bStatus And Not(gbValue) Then
           ' bForceError --> OPTION: DID you want to activate Job_ErrorHandling(), if the sUnInstFile does not exist?
           If bForceError = True Then
                   ' --> REQUIRED: DID you remember to add the sProgramName variable used in sUnInstFile?
                   If bStatus And sProgramName = "" Then
                       bStatus = Job_WriteLog(sThisFunctionName, "-----> " & sInfoPrg & " <-----", bStatus, True)
                   End if
                   bStatus = Job_ErrorHandling(sThisFunctionName, "----- " & sErrorUnInst & " -----", 0)
               Else
                   ' --> REQUIRED: DID you remember to add the sProgramName variable used in sUnInstFile?
                   If bStatus And sProgramName = "" Then
                       bStatus = Job_WriteLog(sThisFunctionName, "-----> " & sInfoPrg & " <-----", bStatus, True)
                   End if
                   bStatus = Job_WriteLog(sThisFunctionName, "-----> " & sInfoUnInst & " <-----", bStatus, True)
           End if
       Else  
               
' The sUnInstFile was found

           If bStatus Then bStatus = Shell_Execute(sUnInstFile, sArgument, bWait, iStyle, bCheckExistence)
           ' bReboot --> OPTION: DID the vendors sUnInstFile file require a reboot
           If bStatus And bReboot Then bStatus = Job_RebootWS(sRebootMsg)
   End if

   UnInstall = bStatus
End Function

If you are using the CapaInstaller Package Creator, there isn't any Inno Setup template, so you need to use the Generic Installer template, where there isn't any 
default switches to use with Inno Setup:



But if you are using my SilentSwitchFinder, the correct silent switches are created, and there are added a lot of extra options and explanations, and a link to all the possible Inno Setup switches and error codes.

The CapaInstaller vbScript lines about InstallShield:


 ' ----------> This is an InstallShield installer. CAPAINSTALLER - I N S T A L L <----------
 ' WARNING: If changes are needed in this file, please contact  with an example and an installer file

Function Install()
 ' ----------------> REQUIRED: You NEED to decide about these variables:
 ' bForceIssFile --> REQUIRED: You can create a setup.iss file with the -r switch, but if not, it might exist from earlier.
 ' Command-line switches and errorlevel codes: http://tryware.dk/support/installersyntax_installshield.html

                        ' --> EXPLANATION <--
                        ' If you DID use the -r switch to create a new sIssFile in the C:\Windows folder, please remember to:
                        '        Change bForceIssFile = True, and copy the setup.iss file to the same folder as the sInstFile,
                        '        or use the -F1 switch to specify an alternate folder and/or name of the setup.iss file.
                        ' If you did NOT use the -r switch, there might be an old setup.iss in the C:\Windows folder.
                        '        If so make sure, that the bForceIssFile = False
                        ' --> EXPLANATION <--

                        ' --> REQUIRED: Did you create a sIssFile using the -r switch?
 Dim bForceIssFile      : bForceIssFile = False

                        ' ---> INFO: These variables are used again in other variables
 Dim sIssFile           : sIssFile = sIssFolder & "\setup.iss"
 Dim sIssFolder         : sIssFolder = "C:\Windows"
                        ' ---> INFO: The above variables are used again in other variables below:

 Dim sArgument          : sArgument = "-s -SMS -z"
 Dim sErrorIss          : sErrorIss = "The job is cancelled, because the sIssFile " & sIssFile & " did not exist!"
 Dim sInstallLog        : sInstallLog = gsWorkstationpath & "Logs\Temp\Ins_" & gsJobName & ".Log"
 Dim sInstallLogTemp    : sInstallLogTemp = gsWorkstationpath & "Logs\Temp\Ins_$ap$.Log"
 Dim sInstFile          : sInstFile = gsPackageRoot & "\Kit\Test_InstallShield_LenovoCamera.exe"
                        ' iStyle (11 different, among others: 0=Hide, 1=Restore, 2, Minimized, 3=Maximized)
 Dim iStyle             : iStyle = 0
 Dim bCheckExistence    : bCheckExistence = True
 Dim bForceDelete       : bForceDelete = True
 Dim bMustExist         : bMustExist = False
 Dim bStatus            : bStatus = True
 Dim bWait              : bWait = True

   If bStatus And bForceIssFile Then
           If bStatus Then bStatus = File_ExistFile(sIssFile, bMustExist)
           If bStatus And gbValue Then
                ' Install with your sIssfile
                 bStatus = Shell_Execute(sInstFile, sArgument & " -F1" & """" & sIssFile & """" & " -F2" & """" & sInstallLogTemp &
                                         """", bWait, iStyle, bCheckExistence)
               Else
                   bStatus = Job_ErrorHandling(sThisFunctionName, "-----> " & sErrorIss & " <-----", 0)
           End if
       Else
           ' Install without any sIssfile
           bStatus = Shell_Execute(sInstFile, sArgument & " -F2" & """" & sInstallLogTemp & """", bWait, iStyle, bCheckExistence)
   End if

   If bStatus Then bStatus = File_DelFile(sInstallLog, bForceDelete)
   If bStatus Then bStatus = File_RenameFile(sInstallLogTemp, sInstallLog)
   If bStatus Then bStatus = Appl_ISResultCode(sInstallLog)

   Install = bStatus
End Function

 ' ----------> This is an InstallShield installer. CAPAINSTALLER - U N I N S T A L L <----------
Function UnInstall()
 ' ----------------------> REQUIRED: You NEED to add info to these variables:
 ' sGuid ------> REQUIRED: The installers sub key found in HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall. You might need  
 '                         to run the Install() 
function first, without the UnInstall() function, in order to find the sGUID
 '                         For the Test_InstallShield_LenovoCamera.exe installer, the sGUID =
 '                                                                                          "{71A51BD9-E7D3-11DB-A386-005056C00008}"
 ' ----------------------> OPTION: You DO   N O T   NEED to add info to these variables:
 ' sGetString ---> OPTION: If Reg_GetString(sGuid) does not exist, maybe select Job_ErrorHandling() instead of Job_WriteLog().
 ' bForceError --> OPTION: Maybe you want to activate Job_ErrorHandling() if sGetString or sUnInstFile and sUnInstArg does not work
 ' bReboot ------> OPTION: Maybe the vendors UnInstall file requires a reboot
 ' ----------------------> OPTION: You   M I G H T   NEED to add info to these variables:
 '                         SilentSwitchFinder tries to find the sUnInstArg and sUnInstFile variables by using the sGetString
 '                         variable, that might get the info 
from the sGuid variable (that you must provide). But in rare cases
 '                         there is no sGuid in the UnInstall 
regkey, and if so, you NEED to add the needed info to the sUnInstArg
 '                         and sUnInstFile variables:
 ' sUnInstArg ---> OPTION: The UnInstall arguments. It might in rare cases not be found in
 '                                                                          HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall
 '                         If so locate the sInstFile exe file according to the sGuid sub folder described about the sGetString
 '                         variable, and make a test to show, i
f the default SilentSwitchFinder variable sUnInstArg = " -runfromtemp
 '                         -l0x0009 -removeonly" works with your sInstFile. Otherwise you
 need to contact the vendor about it.
 ' sUnInstFile --> OPTION: The Installer file located in gsProgramFiles & "\InstallShield Installation Information\" & sGuid
 ' Command-line switches and errorlevel codes: http://tryware.dk/support/installersyntax_installshield.html

 Dim bStatus             : bStatus = True

       ' Maybe use this solution created with CapaInstaller Package Creator?
                ' sProgramName is the name of the InstallShield entry in the Windows Application Manager
       '        Dim sProgramName       : sProgramName = ""
       '        If bStatus Then bStatus = Appl_UninstallISAppl(sProgramName)
       ' But it might not always work, so please consider to use this SilentSwitchFinder solution:

                        ' --> REQUIRED: sGuid = Add the {GUID} from the UnInstall regkeys
 Dim sGuid              : sGuid = "{}"

                        ' --> OPTION: Maybe change the sUnInstArg according to the vendors description.
                        '             BUT ONLY if the sGetString does NOT work below.
                        '             If sGetString works, the sUnInstArg is found in the sGuid
 Dim sUnInstArg         : sUnInstArg = " -runfromtemp -l0x0009 -removeonly"

                        ' --> OPTION: Maybe change the sUnInstFile = gsProgramFiles & "\InstallShield Installation Information\" &
                        '             sGuid & "\" & only the filename of 
sInstFile, BUT ONLY if the sGetString does NOT work below.
                        '             If sGetString works, the sUnInstFile is found in the sGuid
 Dim sUnInstFile        : sUnInstFile = ""

                        ' --> OPTION: Maybe select bStatus = Job_ErrorHandling() if sGuid does not exist
 Dim bForceError        : bForceError = False

                        ' --> OPTION: Maybe the vendors UnInstall file requires a reboot, before the Install() function runs
 Dim bReboot            : bReboot = False

                        ' ---> INFO: These variables is used again in the variables below:
 Dim sInfojob           : sInfoJob = " does not exist!"
 Dim sError             : sError = "The job is cancelled, because you forgot to change the "
                        ' ---> INFO: The above variables is used again in the variables below:

 Dim sGetString         : sGetString = ""
 Dim sHandle            : sHandle = "HKLM"
 Dim sKey               : sKey = "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\" & sGuid
 Dim sErrorGuid         : sErrorGuid = sError & "sGuid=" & sGuid & sInfoJob
 Dim sErrorUnInstArg    : sErrorUnInstArg = sError & "sUnInstArg=" & sUnInstArg & sInfoJob
 Dim sErrorUnInstFile   : sErrorUnInstFile = sError & "sUnInstFile=" & sUnInstFile & sInfoJob
 Dim sRebootMsg         : sRebootMsg = "Your computer is about to be rebooted, because the UnInstaller requested it"
 Dim sThisFunctionName  : sThisFunctionName = "Function UnInstall"
 Dim sVariable          : sVariable = "UninstallString"
                        ' iStyle (11 different, among others: 0=Hide, 1=Restore, 2, Minimized, 3=Maximized)
 Dim iStyle             : iStyle = 0
 Dim iPos
 Dim bCheckExistence    : bCheckExistence = True
 Dim bMustExist         : bMustExist = False
 Dim bWait              : bWait = True

   If bStatus Then bStatus = Reg_GetString(sHandle, sKey, sVariable, bMustExist)
   If bStatus And gbValue Then

   ' The sGuid was found in the UnInstall regkeys.
     sGetString = gsValue
   bStatus = Job_WriteLog(sThisFunctionName, "-----> Found " & sVariable & ": " & sGetString & " <-----", bStatus, True)
              '          1         2         3         4         5         6         7         8         9                 
              ' 1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234
' If sGetString=C:\Program Files\InstallShield Installation Information\{71A51BD9-E7D3-11DB-A386-005056C00008}  
              '                                                    
0         1         2        3         4         5         6
              '                                               5678901234567890123456789012345678901234567890123456789012345678901234
                                                              \Test_InstallShield_LenovoCamera.exe
 -runfromtemp -l0x0009 -removeonly 
           iPos = InStr(1, uCase(sGetString), ".EXE", vbTextCompare)
           If iPos = 0 Then
                   bStatus = Job_WriteLog(sThisFunctionName, "-----> The sInstFile was not found in " & sGetString &
                                                                                                           " <-----", bStatus, True)
               Else
                   sUnInstFile = Left(sGetString, iPos +3)
                   sUnInstArg = Right(sGetString, Len(sGetString) - iPos - 4)        ' 164-127-4 = 33
                   If bStatus Then bStatus = File_ExistFile(sUnInstFile, False)
                   If bStatus And gbValue Then
                       bStatus = Shell_Execute(sUnInstFile, sUnInstArg, bWait, iStyle, bCheckExistence)

                       ' bReboot --> OPTION: DID the vendors sUnInstFile file require a reboot
                       If bStatus And bReboot Then bStatus = Job_RebootWS(sRebootMsg)
                   End if
           End if

       Else

       ' The sGuid was NOT found in the UnInstall regkeys.
           sGetString = gsValue

           ' bForceError --> OPTION: DID you want to activate Job_ErrorHandling(), if sGuid does not exist
           If bForceError = True Then
                   bStatus = Job_ErrorHandling(sThisFunctionName, "----- " & sErrorGuid & " -----", 0)
               Else
                   bStatus = Job_WriteLog(sThisFunctionName, "-----> " & sVariable & ": " & sGetString & sInfoJob & " <-----",  
                                                                                                                      bStatus, True)

                   ' --> REQUIRED: DID you select to add the sUnInstFile variable?
                   If bStatus And sUnInstFile = "" Then
                       bStatus = Job_ErrorHandling(sThisFunctionName, "-----> " & sErrorUnInstFile & " <-----", 0)
                   End if
                                       
                   If bStatus Then bStatus = Shell_Execute(sUnInstFile, sUnInstArg, bWait, iStyle, bCheckExistence)

                   ' bReboot --> OPTION: DID the vendors sUnInstFile file require a reboot
                   If bStatus And bReboot Then bStatus = Job_RebootWS(sRebootMsg)
           End if
   End if

   UnInstall = bStatus
End Function


If you are using the CapaInstaller Package Creator, the silent switches almost always works, but ...

If you are using my SilentSwitchFinder, the correct silent switches are created, and there are added a lot of extra options and explanations, and a link to all the possible InstallShield switches and error codes.


Logfiles when running SilentSwitchFinder



SilentSwitchFinder automatically creates a logfile about all the steps when creating the vbScript functions, and the logfile might also contain error lines, all according to the info- and error numbers in the Setup-LogNumbers.txt file, located in: C:\ITD\TrywareDk\Setup\TW\Bin\32-bit

The SilentSwitchFinder.bak logfile is located in: C:\ITD\TrywareDk\SilentSwitchFinder\TW\Log

Example of the SilentSwitchFinder.bak logfile when creating the CapaInstaller functions for HandyBackup730.msi program
----------------------------------------------------------------------------------------------------
INFO #0042: 20140123 21:37:24 UAC elevating SilentSwitchFinder.exe as asInvoker manifest
INFO #0056: 20140123 21:37:24 Not using a setting, because default value isn't part of syntax
INFO #0063: 20140123 21:37:24 Validating sShowUpdateSearch=Yes
INFO #0063: 20140123 21:37:24 Errorhandling command-line switches when running SilentSwitchFinder.exe
INFO #0063: 20140123 21:38:56 SilentSwitchFinder.exe is analysing Test_HandyBackup730.msi using PEID search type:  M S I E X E C
INFO #0063: 20140123 21:38:59 Searching files in ::{20D04FE0-3AEA-1069-A2D8-08002B30309D}
INFO #0063: 20140123 21:38:59 Searching installer program using CapaInstaller            
INFO #0026: 20140123 21:38:59 4.671 bytes function lines are copied to your clipboard. Paste it into your script using CTRL+V
INFO #0063: 20140123 21:39:46 SilentSwitchFinder.exe - Searching if an update is ready to download ...
INFO #0230: 20140123 21:39:55 Search New Build: Current build version=1.0.0.0, Current installed version=1.0.0.0
INFO #0062: 20140123 21:39:58 Terminating SilentSwitchFinder.exe

The settings ini file you can use to customize the features in SilentSwitchFinder



You can customize SilentSwitchFinder.exe with the SilentSwitchFinder.ini file located in C:\ITD\TrywareDk\SilentSwitchFinder\TW\Ini

;  © Copyright 2001-2015: IT-Programmer J. Malmgren, www.tryware90days.com, Arpil 2015.
;
;   The settings are located 2 times below: In the top the settings you can change, and at the ;   bottom a more detailed syntax
;   description.
;
;   Please Note: Even if you aren't using the www.capasystems.com/computer-device-management CapaInstaller Management System,
;                consider the solution described at the bottom 
under sShowSwitchOrScript
;
;  © Copyright 2001-2015: IT-Programmer J. Malmgren, www.tryware90days.com, Arpil 2015.


[SilentSwitchFinder]
       
---------------- OPT=Optinal, REQ=Required, NOT=Do not Change -------

sDefaultSearchFolder=
OPT Syntax: Fully qualified path without file name. UNC path is allowed.

sEmailNumberOfComputers=many
REQ Syntax: An integer number of your computers, between 1 and 32768 or the word many

iLogFileMaxSize=1024
OPT Syntax: An integer number of kilobytes, between 1024 and 32768
       
sLogFileDir="C:\ITD\TrywareDk\SilentSwitchFinder\TW\Log"
REQ Syntax: Directory path on drive C: for the SilentSwitchFinder log files
       
sShowDefaultSwitches=Yes
OPT Syntax: Yes or No.                                           NoTcAsEsEnSiTiVe

sShowSwitchOrScript=vbScript
OPT Syntax: One, Two, vbScript or CapaInstaller                  NoTcAsEsEnSiTiVe
               
sShowToolTip=Yes
REQ Syntax: Yes or No.                                           NoTcAsEsEnSiTiVe

sSincerely=
OPT: Modify C:\ITD\TrywareDk\SilentSwitchFinder\TW\Ini\Sincerely.txt

sLicenseNumber=
NOT Syntax: Encrypted 100% TryWare license key.


---------------------------> SYNTAX DESCRIPTIONS <--------------------------------------------

; sDefaultSearchFolder:      Full path without file name to the root folder where you save a
;                            backup of all your installer files, and it's from there you create
;                            all your installation scripts using your Management System. When
;                            using SilentSwitchFinder, it will start in this root folder, when
;                            you browse for the installer file to be examined. If errors in this
;                            setting I will use the default=       which will use the "This Com-
;                            puter", where your hard disk and mapped network drives are located.
;                            Syntax: Fully qualified path and file name. UNC path is allowed.
;                                    If the path contains spaces, use " before and after the path.
;                                    A-Z, a-z, 0-9 and : \ "                   NoTcAsEsEnSiTiVe
;
; sEmailNumberOfComputers:   If the installer type can't be determined, an email is ready to
;                            be sent to the vendor. A part of the email is telling the vendor
;                            how many computers you have in your domain. If errors in this
;                            setting I will use the default=many
;                            Syntax: An integer number of your computers, between 1 and 32768
;                                    or the word many                          NoTcAsEsEnSiTiVe
;
; iLogFileMaxSize:           Max size of the 2 *.bak SilentSwitchFinder log files. Older logs will
;                            be deleted without any other backup, and it's NOT part of Backup loca-
;                            ted in theC:\ITD\TrywareDk\Backup\TW\Bin folder. If errors in this
;                            setting the default iLogFileMaxSize=1024 will be used.
;                            Syntax: An integer number of kilobytes, between 1024 and 32768
                       
;
; sLogFileDir:               Directory path for the SilentSwitchFinder log files. If errors in
;                            this setting, the default will be used:
;                            sLogFileDir="C:\ITD\TrywareDk\SilentSwitchFinder\TW\Log"
;                            Syntax: \
;                                    Spaces is not allowed in the path.
;                                    A-Z, a-z, 0-9 and :                       NoTcAsEsEnSiTiVe
;
; sShowDefaultSwitches:      If no switches are found, there's an option to see my website about
;                            all the known switches, and links to other support. Specify if you
;                            want this to happen automatically before seeing the email you can
;                            send to the vendors support. If errors in this setting the default
;                            sShowDefaultSwitches=Yes will be used.
;                            Syntax: Yes or No.                                 NoTcAsEsEnSiTiVe
;
; sShowSwitchOrScript:       What do you want in the clipboard, if SilentSwitchFinder identifies
;                            the installer type, and you are ready to paste the silent switches
;                            into your script using CTRL+V:
;                            One: Only the install silent switches.
;                            Two: Both the install and the un-install silent switches.
;                            vbScript:      Full syntax controlled vbScript Install() and
;                                           UnInstall() functions, with some explanations.
;                            CapaInstaller: Full syntax controlled CapaInstaller Install() and
;                                           UnInstall() functions, with more options that the
;                                           Package Creator produces, and also some explanations.
;
;                            PLEASE NOTE:   If you are using the CapaInstaller Management System,
;                                           select the setting sShowSwitchOrScript=CapaInstaller,
;                                           because you can enable the CapaInstaller option in
;                                           the user interface, and instead of 1-3 lines of
;                                           silent switches, you will get dozens of CapaInstaller
;                                           vbScript syntax controlled lines with full Install()
;                                           and UnInstall functions.
;
;                            PLEASE NOTE:   Even if you aren't using the CapaInstaller Management
;                                           System, you should consider to use the setting
;                                           sShowSwitchOrScript=CapaInstaller, because most of the
;                                           built in CapaLib functions almost explains what's being
;                                           done, and you will get a lot of extra features and
;                                           explanations, that you can use to customize your own
;                                           vbScript in your Management System.
;
;                            If errors in this setting, the default sShowSwitchOrScript=vbScript
;                            will be used.
;                            Syntax: One, Two, vbScript or CapaInstaller        NoTcAsEsEnSiTiVe
;
       
; sShowToolTip:              Do you want a ToolTip info about the CPU progress of running
;                            SilentSwitchFinder. The ToolTip will be shown in upper left corner
;                            of the screen, and is not shown when DashBoard, menu or message-
;                            boxes are shown. If your computer is occupied or runs slow, this
;                            ToolTip feature can help you to see, that SilentSwitchFinder is
;                            working. If errors in this setting, the default sShowToolTip=Yes
;                            will be used.
;                            Syntax: Yes or No.                                 NoTcAsEsEnSiTiVe
;
; sSincerely:                Your greeting when sending an email to the vendor about missing
;                            silent switches, can be modified in the Sincerely.txt file located
;                            in the C:\ITD\TrywareDk\SilentSwitchFinder\TW\Ini folder. If the
;                            number of characters in the Sincerely.txt file is less than 10,
;                            the default=Sincerely will be used.
;                            Syntax: All valid ascii characters                 NoTcAsEsEnSiTiVe
;
; sLicenseNumber;            Don't type anything yourself, otherwise you might get an error. I
;                            will do it for you.
;                            Syntax: Binary encrypted 100% TryWare license key.
As you can see in the EULA-Copyright.txt located in the C:\ITD\TrywareDk\Setup\FW\Bin\32-bit folder, you have a license to use the 100% FreeWare programs, but with the exception that you don't have license to distribute the100% FreeWare programs. So if you want to give the 100% FreeWare programs to a friend, then don't do anything else than give them the download link. There is no restrictions in the 100% FreeWare programs, except showing you the donation website each time you have used the100% FreeWare programs 90 days.
The "PE iDentifier" 100 % freeware feature  is used from another thirdparty Vendor, but this feature only determines a few of the installers that is  being used, and doesn't produce any silent switches, or any vbScript lines.
 
Last updated: 14-04-2018
Contact        Privacy Policy        Site Statistics        Sitemap        Terms of use       
Back to content