====== MSI to OPSI ====== Tested on: Win7 64-bit Requieres: Powershell 2.0, MSI Module for Powershell Download MSI Module for Powershell: http://psmsi.codeplex.com/ Dieses Powershellscript extrahiert informationen aus MSI Paketen und erstellt automatisiert anhand eines Templates fertige Opsiskripte inkl. control-Datei und der passenden Verzeichnisstruktur um die fertigen Daten auf den Opsiserver kopieren zu können. Verzeichnisstruktur Basefolder └── msi_to_opsi.ps1 ├── Pool └── Templates ├── CLIENT_DATA │ ├── setup.ins │ ├── uninstall.ins │ ├── delsub.ins │ └── check_exitcode │ └── check_msi-exitcode.ins └── OPSI └── control ===== msi_to_opsi.ps1 ===== # Version: 0.1 # Date: 30.7.2013 # Author: Chris # Description: Retrieve informations from multiple MSI files and create OPSI package scripts from that. # How to use: MSI Files in poolfoldername will be processed by msi powershell module. Place MSI files in folder pool, run script, retrieve ready to use Opsi scripts from folder OUTPUT $testmodulemsi = Get-Module -ListAvailable | Where-Object { $_.name -eq "MSI" } if (($testmodulemsi)) { Import-Module -Name MSI -ErrorAction SilentlyContinue Write-Host "Module MSI loaded." } else { Write-Host `n"FATAL ERROR: Module MSI not available on this system. Please install Module MSI for PowerShell first. You can get it from here http://psmsi.codeplex.com/" `n Write-Host "THIS IS A FATAL ERROR. EXITING NOW."`n`n exit } $DateTime = (Get-Date -Format s) -Replace "T", "_" -Replace ":", "." ## Specify some global settings $BaseFolder = "C:\msi_to_opsi" # Poolfoldername is the location with the basefolder where the installers and theire procducte images are located. $PoolFolderName = "Pool" $InputFolder = $BaseFolder + "\" + $PoolFolderName + "\" # OPSI Package Parameter $DefaultValueMinimumspace = "1000 MB" $priority = "0" $packageversion = "1_autoconvert" # Set Log Folder $LogFolder = "$BaseFolder\Logs" If(!(Test-Path "$BaseFolder\Logs")){New-Item -ItemType Directory -Path "$BaseFolder\Logs"} $log = $LogFolder + "\create_opsi_packages_" + $DateTime +".log" # MSI Parameter $installparameter = "/gb-! REBOOT=REALLYSUPPRES" $uninstallparameter = "/gb-! REBOOT=REALLYSUPPRES" # Move finishe packages to Opsi server. Not implementet (yet) $CopyToOpsiServer = $false $OpsiServerName = "opsi2" $OpsiUserName = "pcpatch" $OpsiPasswordName = "1234" $CreatedLinuxShellScript = $false foreach ($msifile in Get-ChildItem .\Pool -Filter *.msi -name) { $fullmsifile = $InputFolder + $msifile $productName = get-msitable $fullmsifile -table Property | where-object { $_.Property -eq "ProductName" } | select-object -expand Value $productNameFlat = ($productName) -Replace " ", "_" #-Replace "'('", "_" -Replace "')'", "_" -Replace "[", "_" -Replace "]", "_" $description = "Automatically translated MSI-Package: " + $productName $progamversion = get-msitable $fullmsifile -table Property | where-object { $_.Property -eq "ProductVersion" } | select-object -expand Value $msiid = get-msitable $fullmsifile -table Property | where-object { $_.Property -eq "ProductCode" } | select-object -expand Value $uninstallprogramm = $msifile $uninstallprogramm = $msifile $installexec = $msifile write-host "Paket: " $productName $packagename = $productName.ToLower() $OutputPackageFolder = $BaseFolder + "\OUTPUT\$productNameFlat" $InstallerExecutable = $fullmsifile $OutputPackageFolderClientData = $OutputPackageFolder + '\CLIENT_DATA\' # Create packagefolder structur "Building Opsipackage: " + $productName + "`n" + "`n" | Out-File $log -append If(!(Test-Path "$OutputPackageFolder")) { New-Item -ItemType Directory -Path "$OutputPackageFolder" "Created folder " + $OutputPackageFolder | Out-File $log -append } Else { "SKIPPED: Folder " + $OutputPackageFolder + " already exists." | Out-File $log -append } If(!(Test-Path "$OutputPackageFolder\OPSI")) { New-Item -ItemType Directory -Path "$OutputPackageFolder\OPSI" "Created folder " + $OutputPackageFolder + "\OPSI" | Out-File $log -append } Else { "SKIPPED: Folder " + $OutputPackageFolder + "\OPSI already exists."| Out-File $log -append } If(!(Test-Path "$OutputPackageFolder\CLIENT_DATA")) { New-Item -ItemType Directory -Path "$OutputPackageFolder\CLIENT_DATA" "Created folder " + $OutputPackageFolder + "\CLIENT_DATA" | Out-File $log -append } Else { "SKIPPED: Folder " + $OutputPackageFolder + "\CLIENT_DATA already exists."| Out-File $log -append } $minimumspace = $DefaultValueMinimumspace # Create setup.ins $original_file_setup_ins = $BaseFolder + '\Templates\CLIENT_DATA\setup.ins' $destination_file_setup_ins = $OutputPackageFolder + '\CLIENT_DATA\setup.ins' (Get-Content $original_file_setup_ins) | Foreach-Object { $_ -replace 'PSVAR_PACKAGENAME', $packagename ` -replace 'PSVAR_MINIMUMSPACE', $minimumspace ` -replace 'PSVAR_INSTALLDIR', $installdir ` -replace 'PSVAR_INSTALLEXEC', $installexec ` -replace 'PSVAR_INSTALLPARAMETER', $installparameter ` -replace 'PSVAR_UNINSTALLPARAMETER', $uninstallparameter ` -replace 'PSVAR_UNINSTALLPROGRAMM', $uninstallprogramm ` -replace 'PSVAR_INSTALLSTRING', $installstring ` -replace 'PSVAR_EXITCODECHECKSTRING', $ExitCodeCheckstring ` -replace 'PSVAR_MSIID', $msiid ` -replace 'PSVAR_PRODUCTNAME', $productName } | Set-Content $destination_file_setup_ins # Create uninstall.ins $original_file_uninstall_ins = $BaseFolder + '\Templates\CLIENT_DATA\uninstall.ins' $destination_file_uninstall_ins = $OutputPackageFolder + '\CLIENT_DATA\uninstall.ins' (Get-Content $original_file_uninstall_ins) | Foreach-Object { $_ -replace 'PSVAR_PACKAGENAME', $packagename ` -replace 'PSVAR_MINIMUMSPACE', $minimumspace ` -replace 'PSVAR_INSTALLDIR', $installdir ` -replace 'PSVAR_INSTALLEXEC', $installexec ` -replace 'PSVAR_INSTALLPARAMETER', $installparameter ` -replace 'PSVAR_UNINSTALLPARAMETER', $uninstallparameter ` -replace 'PSVAR_UNINSTALLPROGRAMM', $uninstallprogramm ` -replace 'PSVAR_INSTALLSTRING', $installstring ` -replace 'PSVAR_MSIID', $msiid ` -replace 'PSVAR_PRODUCTNAME', $productName } | Set-Content $destination_file_uninstall_ins # Create delsub.ins $original_file_delsub_ins = $BaseFolder + '\Templates\CLIENT_DATA\delsub.ins' $destination_file_delsub_ins = $OutputPackageFolder + '\CLIENT_DATA\delsub.ins' (Get-Content $original_file_delsub_ins) | Foreach-Object { $_ -replace 'PSVAR_PACKAGENAME', $packagename ` -replace 'PSVAR_MINIMUMSPACE', $minimumspace ` -replace 'PSVAR_INSTALLDIR', $installdir ` -replace 'PSVAR_INSTALLEXEC', $installexec ` -replace 'PSVAR_INSTALLPARAMETER', $installparameter ` -replace 'PSVAR_UNINSTALLPARAMETER', $uninstallparameter ` -replace 'PSVAR_UNINSTALLPROGRAMM', $uninstallprogramm ` -replace 'PSVAR_INSTALLSTRING', $installstring ` -replace 'PSVAR_EXITCODECHECKSTRING', $ExitCodeCheckstring ` -replace 'PSVAR_MSIID', $msiid } | Set-Content $destination_file_delsub_ins # Create OPSI Controlfile $original_file_opsi_control = $BaseFolder + "\Templates\OPSI\control" $destination_file_opsi_control = $OutputPackageFolder + "\OPSI\control" (Get-Content $original_file_opsi_control) | Foreach-Object { $_ -replace "PSVAR_PACKAGENAME", $packagename ` -replace 'PSVAR_PACKAGEVERSION', $packageversion ` -replace 'PSVAR_DESCRIPTION', $description ` -replace 'PSVAR_NAME', $productname ` -replace 'PSVAR_PROGRAMMVERSION', $progamversion ` -replace 'PSVAR_PRIORITY', $priority } | Set-Content $destination_file_opsi_control # Copy executable files und producticons If(!(Test-Path $InstallerExecutable)) { Write-Host "Error: Installerfile ($InstallerExecutable) not found, package will not be complete" "Error: Installerfile ($InstallerExecutable) not found, package will not be complete" | Out-File $log -append } Else { Copy-Item -Path $InstallerExecutable -Destination $OutputPackageFolderClientData } } ===== setup.ins ===== [Actions] requiredWinstVersion >= "4.10.8.6" DefVar $MsiId$ DefVar $UninstallProgram$ DefVar $LogDir$ DefVar $ProductId$ DefVar $MinimumSpace$ DefVar $InstallDir$ DefVar $InstallProg$ DefVar $ExitCode$ DefVar $UninstCMD$ DefVar $InstCMD$ DefVar $DisplayName$ DefVar $ProductName$ Set $LogDir$ = "%SystemDrive%\tmp" ; ---------------------------------------------------------------- ; - Please edit the following values - ; ---------------------------------------------------------------- ;$ProductId$ should be the name of the product in opsi ; therefore please: only lower letters, no umlauts, ; no white space use '-' as a seperator Set $ProductId$ = "PSVAR_PACKAGENAME" Set $ProductName$ = "PSVAR_PRODUCTNAME" Set $MinimumSpace$ = "PSVAR_MINIMUMSPACE" Set $InstallDir$ = "PSVAR_INSTALLDIR" Set $InstallProg$ = "PSVAR_INSTALLEXEC" Set $UninstallProgram$ = "PSVAR_UNINSTALLPROGRAMM" Set $UninstCMD$ = " PSVAR_UNINSTALLPARAMETER" Set $InstCMD$ = " PSVAR_INSTALLPARAMETER" Set $MsiId$ = "PSVAR_MSIID" ; ---------------------------------------------------------------- if not(HasMinimumSpace ("%SystemDrive%", $MinimumSpace$)) LogError "Not enough space on %SystemDrive%, " + $MinimumSpace$ + " on drive %SystemDrive% needed for " + $ProductId$ isFatalError ; Stop process and set installation status to failed else if FileExists("%ScriptPath%\delsub.ins") comment "Start uninstall sub section" Sub "%ScriptPath%\delsub.ins" endif Message "Installing " + $ProductName$ Winbatch_install sub %scriptpath%\check_exitcode\check_msi-exitcode.ins endif [Winbatch_install] msiexec /i $InstallProg$ $InstCMD$ === uninstall.ins === [Actions] requiredWinstVersion >= "4.10.8.6" DefVar $MsiId$ DefVar $UninstallProgram$ DefVar $LogDir$ DefVar $ProductId$ DefVar $MinimumSpace$ DefVar $InstallDir$ DefVar $InstallProg$ DefVar $ExitCode$ DefVar $UninstCMD$ DefVar $InstCMD$ DefVar $DisplayName$ DefVar $ProductName$ Set $LogDir$ = "%SystemDrive%\tmp" ; ---------------------------------------------------------------- ; - Please edit the following values - ; ---------------------------------------------------------------- ;$ProductId$ should be the name of the product in opsi ; therefore please: only lower letters, no umlauts, ; no white space use '-' as a seperator Set $ProductId$ = "PSVAR_PACKAGENAME" Set $ProductName$ = "PSVAR_PRODUCTNAME" Set $MinimumSpace$ = "PSVAR_MINIMUMSPACE" Set $InstallDir$ = "PSVAR_INSTALLDIR" Set $InstallProg$ = "PSVAR_INSTALLEXEC" Set $UninstallProgram$ = "PSVAR_UNINSTALLPROGRAMM" Set $UninstCMD$ = " PSVAR_UNINSTALLPARAMETER" Set $InstCMD$ = " PSVAR_INSTALLPARAMETER" Set $MsiId$ = "PSVAR_MSIID" ; ---------------------------------------------------------------- Message "Uninstalling " + $ProductId$ + " ..." if FileExists("%ScriptPath%\delsub.ins") comment "Start uninstall sub section" Sub "%ScriptPath%\delsub.ins" else Log "FATAL: Uninstall script not found." Message "Uninstall failed. Script not found." endif ===== delsub.ins ===== Set $DisplayName$ = GetRegistrystringvalue32("[HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$MsiId$] DisplayName") if not ($DisplayName$ = "") comment "MSI ID found in Registry, starting uninstall" Message "Uninstalling "+$ProductName$ set $UninstallProgram$ = "MsiExec.exe /x $MsiId$" Winbatch_Uninstall sub %scriptpath%\check_exitcode\check_msi-exitcode.ins else comment "Program not installed. No Problem." endif Set $DisplayName$ = GetRegistrystringvalue64("[HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$MsiId$] DisplayName") if not ($DisplayName$ = "") comment "MSI ID found in Registry, starting uninstall" Message "Uninstalling "+$ProductName$ set $UninstallProgram$ = "MsiExec.exe /x $MsiId$" Winbatch_Uninstall sub %scriptpath%\check_exitcode\check_msi-exitcode.ins else comment "Program not installed. No Problem." endif [Winbatch_uninstall] "$UninstallProgram$" $UninstCMD$ ===== control ===== [Package] version: PSVAR_PACKAGEVERSION depends: incremental: False [Product] type: localboot id: PSVAR_PACKAGENAME name: PSVAR_NAME description: PSVAR_DESCRIPTION advice: version: PSVAR_PROGRAMMVERSION priority: PSVAR_PRIORITY licenseRequired: False productClasses: setupScript: setup.ins uninstallScript: uninstall.ins updateScript: alwaysScript: onceScript: customScript: userLoginScript: ===== check_msi-exitcode.ins ===== ;Den ExitCode des Installers abfragen set $ExitCode$ = getLastExitCode ;Loglevel anpassen setLogLevel = 4 ;Den ExitCode auswerten if ($ExitCode$ = "0" OR $ExitCode$ ="1641" OR $ExitCode$ ="3010") if ($ExitCode$ = "0") setLogLevel = 5 comment "ExitCode = "+$ExitCode$+" Action completed successfully." setLogLevel = 4 endif if ($ExitCode$ = "1641") setLogLevel = 5 comment "ExitCode = "+$ExitCode$+" ERROR_SUCCESS_REBOOT_INITIATED The installer has started a reboot. This error code not available on Windows Installer version 1.0." setLogLevel = 4 endif if ($ExitCode$ = "3010") setLogLevel = 5 comment "ExitCode = "+$ExitCode$+" ERROR_SUCCESS_REBOOT_REQUIRED A reboot is required to complete the install. This does not include installs where the ForceReboot action is run. This error code not available on Windows Installer version 1.0." setLogLevel = 4 endif else if ($ExitCode$ = "13") setLogLevel = 5 logError "ExitCode = "+$ExitCode$+" ERROR_INVALID_DATA The data is invalid." isFatalError endif if ($ExitCode$ = "87") setLogLevel = 5 logError "ExitCode = "+$ExitCode$+" ERROR_INVALID_PARAMETER One of the parameters was invalid." isFatalError endif if ($ExitCode$ = "120") setLogLevel = 5 logError "ExitCode = "+$ExitCode$+" ERROR_CALL_NOT_IMPLEMENTED This function is not available for this platform. It is only available on Windows 2000 and Windows XP with Window Installer version 2.0." isFatalError endif if ($ExitCode$ = "1259") setLogLevel = 5 logError "ExitCode = "+$ExitCode$+" ERROR_APPHELP_BLOCK This error code only occurs when using Windows Installer version 2.0 and Windows XP or later. If Windows Installer determines a product may be incompatible with the current operating system, it displays a dialog informing the user and asking whether to try to install anyway. This error code is returned if the user chooses not to try the installation." isFatalError endif if ($ExitCode$ = "1601") setLogLevel = 5 logError "ExitCode = "+$ExitCode$+" ERROR_INSTALL_SERVICE_FAILURE The Windows Installer service could not be accessed. Contact your support personnel to verify that the Windows Installer service is properly registered." isFatalError endif if ($ExitCode$ = "1602") setLogLevel = 5 logError "ExitCode = "+$ExitCode$+" ERROR_INSTALL_USEREXIT User cancel installation." isFatalError endif if ($ExitCode$ = "1603") setLogLevel = 5 logError "ExitCode = "+$ExitCode$+" ERROR_INSTALL_FAILURE Fatal error during installation." isFatalError endif if ($ExitCode$ = "1604") setLogLevel = 5 logError "ExitCode = "+$ExitCode$+" ERROR_INSTALL_SUSPEND Installation suspended, incomplete." isFatalError endif if ($ExitCode$ = "1605") setLogLevel = 5 logError "ExitCode = "+$ExitCode$+" ERROR_UNKNOWN_PRODUCT This action is only valid for products that are currently installed." isFatalError endif if ($ExitCode$ = "1606") setLogLevel = 5 logError "ExitCode = "+$ExitCode$+" ERROR_UNKNOWN_FEATURE Feature ID not registered." isFatalError endif if ($ExitCode$ = "1607") setLogLevel = 5 logError "ExitCode = "+$ExitCode$+" ERROR_UNKNOWN_COMPONENT Component ID not registered." isFatalError endif if ($ExitCode$ = "1608") setLogLevel = 5 logError "ExitCode = "+$ExitCode$+" ERROR_UNKNOWN_PROPERTY Unknown property." isFatalError endif if ($ExitCode$ = "1609") setLogLevel = 5 logError "ExitCode = "+$ExitCode$+" ERROR_INVALID_HANDLE_STATE Handle is in an invalid state." isFatalError endif if ($ExitCode$ = "1610") setLogLevel = 5 logError "ExitCode = "+$ExitCode$+" ERROR_BAD_CONFIGURATION The configuration data for this product is corrupt. Contact your support personnel." isFatalError endif if ($ExitCode$ = "1611") setLogLevel = 5 logError "ExitCode = "+$ExitCode$+" ERROR_INDEX_ABSENT Component qualifier not present." isFatalError endif if ($ExitCode$ = "1612") setLogLevel = 5 logError "ExitCode = "+$ExitCode$+" ERROR_INSTALL_SOURCE_ABSENT The installation source for this product is not available. Verify that the source exists and that you can access it." isFatalError endif if ($ExitCode$ = "1613") setLogLevel = 5 logError "ExitCode = "+$ExitCode$+" ERROR_INSTALL_PACKAGE_VERSION This installation package cannot be installed by the Windows Installer service. You must install a Windows service pack that contains a newer version of the Windows Installer service." isFatalError endif if ($ExitCode$ = "1614") setLogLevel = 5 logError "ExitCode = "+$ExitCode$+" ERROR_PRODUCT_UNINSTALLED Product is uninstalled." isFatalError endif if ($ExitCode$ = "1615") setLogLevel = 5 logError "ExitCode = "+$ExitCode$+" ERROR_BAD_QUERY_SYNTAX SQL query syntax invalid or unsupported." isFatalError endif if ($ExitCode$ = "1616") setLogLevel = 5 logError "ExitCode = "+$ExitCode$+" ERROR_INVALID_FIELD Record field does not exist." isFatalError endif if ($ExitCode$ = "1618") setLogLevel = 5 logError "ExitCode = "+$ExitCode$+" ERROR_INSTALL_ALREADY_RUNNING Another installation is already in progress. Complete that installation before proceeding with this install." isFatalError endif if ($ExitCode$ = "1619") setLogLevel = 5 logError "ExitCode = "+$ExitCode$+" ERROR_INSTALL_PACKAGE_OPEN_FAILED This installation package could not be opened. Verify that the package exists and that you can access it, or contact the application vendor to verify that this is a valid Windows Installer package." isFatalError endif if ($ExitCode$ = "1620") setLogLevel = 5 logError "ExitCode = "+$ExitCode$+" ERROR_INSTALL_PACKAGE_INVALID This installation package could not be opened. Contact the application vendor to verify that this is a valid Windows Installer package." isFatalError endif if ($ExitCode$ = "1621") setLogLevel = 5 logError "ExitCode = "+$ExitCode$+" ERROR_INSTALL_UI_FAILURE There was an error starting the Windows Installer service user interface. Contact your support personnel." isFatalError endif if ($ExitCode$ = "1622") setLogLevel = 5 logError "ExitCode = "+$ExitCode$+" ERROR_INSTALL_LOG_FAILURE Error opening installation log file. Verify that the specified log file location exists and is writable." isFatalError endif if ($ExitCode$ = "1623") setLogLevel = 5 logError "ExitCode = "+$ExitCode$+" ERROR_INSTALL_LANGUAGE_UNSUPPORTED This language of this installation package is not supported by your system." isFatalError endif if ($ExitCode$ = "1624") setLogLevel = 5 logError "ExitCode = "+$ExitCode$+" ERROR_INSTALL_TRANSFORM_FAILURE Error applying transforms. Verify that the specified transform paths are valid." isFatalError endif if ($ExitCode$ = "1625") setLogLevel = 5 logError "ExitCode = "+$ExitCode$+" ERROR_INSTALL_PACKAGE_REJECTED This installation is forbidden by system policy. Contact your system administrator." isFatalError endif if ($ExitCode$ = "1626") setLogLevel = 5 logError "ExitCode = "+$ExitCode$+" ERROR_FUNCTION_NOT_CALLED Function could not be executed." isFatalError endif if ($ExitCode$ = "1627") setLogLevel = 5 logError "ExitCode = "+$ExitCode$+" ERROR_FUNCTION_FAILED Function failed during execution." isFatalError endif if ($ExitCode$ = "1628") setLogLevel = 5 logError "ExitCode = "+$ExitCode$+" ERROR_INVALID_TABLE Invalid or unknown table specified." isFatalError endif if ($ExitCode$ = "1629") setLogLevel = 5 logError "ExitCode = "+$ExitCode$+" ERROR_DATATYPE_MISMATCH Data supplied is of wrong type." isFatalError endif if ($ExitCode$ = "1630") setLogLevel = 5 logError "ExitCode = "+$ExitCode$+" ERROR_UNSUPPORTED_TYPE Data of this type is not supported." isFatalError endif if ($ExitCode$ = "1631") setLogLevel = 5 logError "ExitCode = "+$ExitCode$+" ERROR_CREATE_FAILED The Windows Installer service failed to start. Contact your support personnel." isFatalError endif if ($ExitCode$ = "1632") setLogLevel = 5 logError "ExitCode = "+$ExitCode$+" ERROR_INSTALL_TEMP_UNWRITABLE The temp folder is either full or inaccessible. Verify that the temp folder exists and that you can write to it." isFatalError endif if ($ExitCode$ = "1633") setLogLevel = 5 logError "ExitCode = "+$ExitCode$+" ERROR_INSTALL_PLATFORM_UNSUPPORTED This installation package is not supported on this platform. Contact your application vendor." isFatalError endif if ($ExitCode$ = "1634") setLogLevel = 5 logError "ExitCode = "+$ExitCode$+" ERROR_INSTALL_NOTUSED Component not used on this machine" isFatalError endif if ($ExitCode$ = "1635") setLogLevel = 5 logError "ExitCode = "+$ExitCode$+" ERROR_PATCH_PACKAGE_OPEN_FAILED This patch package could not be opened. Verify that the patch package exists and that you can access it, or contact the application vendor to verify that this is a valid Windows Installer patch package." isFatalError endif if ($ExitCode$ = "1636") setLogLevel = 5 logError "ExitCode = "+$ExitCode$+" ERROR_PATCH_PACKAGE_INVALID This patch package could not be opened. Contact the application vendor to verify that this is a valid Windows Installer patch package." isFatalError endif if ($ExitCode$ = "1637") setLogLevel = 5 logError "ExitCode = "+$ExitCode$+" ERROR_PATCH_PACKAGE_UNSUPPORTED This patch package cannot be processed by the Windows Installer service. You must install a Windows service pack that contains a newer version of the Windows Installer service." isFatalError endif if ($ExitCode$ = "1638") setLogLevel = 5 logError "ExitCode = "+$ExitCode$+" ERROR_PRODUCT_VERSION Another version of this product is already installed. Installation of this version cannot continue. To configure or remove the existing version of this product, use Add/Remove Programs on the Control Panel." isFatalError endif if ($ExitCode$ = "1639") setLogLevel = 5 logError "ExitCode = "+$ExitCode$+" ERROR_INVALID_COMMAND_LINE Invalid command line argument. Consult the Windows Installer SDK for detailed command line help." isFatalError endif if ($ExitCode$ = "1640") setLogLevel = 5 logError "ExitCode = "+$ExitCode$+" ERROR_INSTALL_REMOTE_DISALLOWED Installation from a Terminal Server client session not permitted for current user." isFatalError endif if ($ExitCode$ = "1642") setLogLevel = 5 logError "ExitCode = "+$ExitCode$+" ERROR_PATCH_TARGET_NOT_FOUND The installer cannot install the upgrade patch because the program being upgraded may be missing or the upgrade patch updates a different version of the program. Verify that the program to be upgraded exists on your computer and that you have the correct upgrade patch. This error code is not available on Windows Installer version 1.0." isFatalError endif if ($ExitCode$ = "1643") setLogLevel = 5 logError "ExitCode = "+$ExitCode$+" ERROR_PATCH_PACKAGE_REJECTED The patch package is not permitted by system policy. This error code is available with Windows Installer versions 2.0 or later." isFatalError endif if ($ExitCode$ = "1644") setLogLevel = 5 logError "ExitCode = "+$ExitCode$+" ERROR_INSTALL_TRANSFORM_REJECTED One or more customizations are not permitted by system policy. This error code is available with Windows Installer versions 2.0 or later." isFatalError endif endif ;Loglevel anpassen setLogLevel = 6