ich habe das Gefühl, dass unsere Vorlage für die Setup.inf um einiges schlanker sein könnte.
Könntet Ihr mir helfen, welche Sektionen wirklich notwendig sind und welche ich nur bei bedarf hinzufügen sollte? Des weiteren bin ich mir auch nicht sicher, ob der Inhalt der Sektionen so sein muss.
Anbei unsere Vorlage:
Code: Select all
[SetupInfo]
Author =
CreationDate =
InventoryID =
Description =
Method = Unattended
Tested on = Windows Server 2008 R2
Dependencies =
Command line options = /S2
Last Change =
Build =
[VarDefInfo]
[Setup]
Version=15.0
ShowCaption=1
BlockInput=0
Platform=*
[Requirements]
[Application]
ProductName={ProductName}
DeveloperName={DeveloperName}
Version={Version}
Revision={Revision}
SetupName=%ProductName% %Version% %SetupWizard%
Text1="%ProductName% %Version%", Arial, 30, , 00FFFF, 4, , LEFT BOLD ITALIC
Text2="%DeveloperName%", Arial, 24, , 00FFFF, 4, , LEFT BOLD ITALIC
Text8="%Company%", Arial, 18, , 00FFFF, 4, 10, RIGHT BOLD ITALIC
Text9="%InstallationFor% %WindowsUser%", Arial, 16, , 007F00, 4, -18, BOTTOM ITALIC LEFT
BackgroundColor=FF0000,000000
CopyDialogRect=0%, 0%, 100%, 100%, HCENTER VCENTER
UserKeyName=Empirum\%DeveloperName%\%ProductName%
MachineKeyName=Empirum\%DeveloperName%\%ProductName%\%Version%
UninstallKeyName=%DeveloperName% %ProductName% %Version%
UninstallDisplayName=%ProductName% %Version%
UninstallString=%ReinstallString% /U
ReinstallString="%CommonSetupDir%\Setup.exe" "%App%\%SetupInfDir%\Setup.inf"
ReinstallMode=1
SrcDir=..
ApplicationDir=%ProgramFilesDir%\%ProductName%
;ApplicationDir=%ProgramFilesDir%\Empirum\%DeveloperName%\%ProductName%
SetupInfDir=Install
DataDir=%Personal%
AskUninstallOld=1
ShellLinks=1
CommonShellLinks=1
CreateUnresolvableShellLinks=1
UseStringSection=Strings:09
UseSysStringSection=SysStrings:09
DateWarning=1
SizeWarning=1
Reboot={UnattRebootFlg}
PreventExternalReboot=1
StartServicesOnReboot=0
CallTimeOut=3600
AbortAfterCallTimeOut=1
DisableCancelButton=1
ShowEndMessage=1
EndMessage=%EndMessageDesc%
[Strings:07]
Disk1=Installationsmedium 1
EndMessageDesc=Die Installation wurde erfolgreich abgeschlossen!
ErrorLogMessage=Die Installation/Deinstallation wurde mit einer Fehlermeldung abgebrochen!
InstallationFor=Installation für:
InstallerDesc=Dienstprogramm zum Installieren einzelner Komponenten.
InstallerName=Installationsprogramm
SetupWizard=Installations-Assistent
Uninstallation=deinstallieren
ErrorText=Fehler
CallingText=beim Aufruf von
[Strings:09]
Disk1=Installation media 1
EndMessageDesc=Installation was completed successfully!
ErrorLogMessage=The installation/uninstallation aborted with an error message!
InstallationFor=Installation for:
InstallerDesc=Service program to install single components.
InstallerName=Setup program
SetupWizard=Installation Wizard
Uninstallation=Uninstallation
ErrorText=Error
CallingText=launching
[SysStrings:07]
Users=Benutzer
[SysStrings:09]
Users=Users
[Environment]
CommonSetupDir=%CommonFilesDir%\Setup%SetupBits%
V_MachineValuesPath=\\%EmpirumServer%\Values$\MachineValues\%DomainName%
V_UserValuesPath=%HKLM,"Software\matrix42\Software Depot","HomeServer"%\Values$\UserValues\%UserDomain%
; Maschinenabhängige Variablen
; machine dependent variables
;VM_<Variable>=%%%V_MachineValuesPath%\%ComputerName%.ini,%ComputerName%,<Variable>%%
; Userabhängige Variablen
; user dependent variables
;VU_<Variable>=%%%V_UserValuesPath%\%WindowsUser%.ini,%WindowsUser%,<Variable>%%
; !!! Setzen der entsprechenden ReplaceEnv Befehle für die Variablen im Abschnitt [Product] nicht vergessen!!!
; !!! Don't forget to set the appropriate ReplaceEnv instructions for the variables in the section [Product]!!!
; ###########################################################################################################
VM_ServerFunction=Mid ("%ComputerName%", 10, 3)
VM_UninstallKey=Nokey
VM_InstallManually=True
VM_InstallManually=False
;VM_DisplayIcon=.ico
VM_FarmName=%%%V_MachineValuesPath%\%ComputerName%.ini,%ComputerName%,_FarmName%%
VM_Location=%%%V_MachineValuesPath%\%ComputerName%.ini,%ComputerName%,_Location%%
;AppSetupEnvironment
VM__AppSetupFile=%SystemDrive%\_CitrixScripts\AppSetup.ini
VM__AppSetupNumberSection=Count
VM__AppSetupNumber=Number
VM__AppSetupExecutableSection=Executes
VM__AppSetupExecutable=Executable
VM__AppSetupExecutableValue="%App%\UserFiles\Install.exe" "%App%\UserFiles\Install.inf" /S0
; ###########################################################################################################
[Encryption]
[Disks]
1=%Disk1%
[Options]
Installer = %InstallerName%, COPYALWAYS, Installer, "%InstallerDesc%"
Product = %ProductName%, COPYALWAYS, Product, "%ProductDesc%"
[OptionDependencies]
[OptionGroups]
[Installer]
;Create language folder for resource DLLs
1:, %System%\Lang\, CREATE DIRECTORY CASCADED, 0
#Set:Langx86, WINDOWS32
#Set:Langx64, WINDOWS64
1:..\..\..\..\..\..\User\Setup.exe, %CommonSetupDir%, OPTIONAL USEFILENAME DIRECTORY NOSIZEWARNING SETUP, 0
1:..\..\..\..\..\..\User\SetupDeu.chm, %CommonSetupDir%, OPTIONAL USEFILENAME DIRECTORY NOSIZEWARNING SETUP, 0
1:..\..\..\..\..\..\User\SetupEnu.chm, %CommonSetupDir%, OPTIONAL USEFILENAME DIRECTORY NOSIZEWARNING SETUP, 0
1:..\..\..\..\..\..\User\Mx42SynSem.dll, %System%, OPTIONAL USEFILENAME DIRECTORY NOSIZEWARNING SETUP WINDOWS32, 0
1:..\..\..\..\..\..\User\x64\Mx42SynSem.dll, %System%, OPTIONAL USEFILENAME DIRECTORY NOSIZEWARNING SETUP WINDOWS64, 0
1:%SetupInfDir%\Setup.inf, , NORMAL, 0
1:%Temp%\Setup64.exe, %CommonSetupDir%\Setup.exe, OPTIONAL NOSIZEWARNING SETUP ALWAYS WINDOWS64, 0
[Set:Langx86]
Callhidden xcopy "%Src%\..\..\..\..\..\..\User\Lang\Mx42SynSemRes_*.*" "%System%\Lang" /S /E /H /Z /Y
[Set:Langx64]
Callhidden xcopy "%Src%\..\..\..\..\..\..\User\x64\Lang\Mx42SynSemRes_*.*" "%System%\Lang" /S /E /H /Z /Y
[FileCheckMachine]
ReplaceEnv V_MachineValuesPath
If DoesFileExist ("%V_MachineValuesPath%\%ComputerName%.ini") == "0" Then "FileIsntThere" EndIf
[FileCheckClient]
ReplaceEnv V_UserValuesPath
If "%UserDomain%" <> "%ComputerName%" Then "CheckClientFile" EndIf
[CheckClientFile]
If DoesFileExist ("%V_UserValuesPath%\%WindowsUser%.ini") == "0" Then "FileIsntThere" EndIf
[FileIsntThere]
ErrorLogMsg Values$\MachineValues\%DomainName%\%ComputerName%.ini or Values$\UserValues\%UserDomain%\%WindowsUser%.ini not found!
Abort
[Processes]
;<label1>="<processname>", "<text>", ABORT
;<label2>="<processname>", "<text>", KILLPROCESS
[Product]
;#FileCheckMachine, MACHINE
;#FileCheckClient, CLIENT
ReplaceEnv VM_FarmName
ReplaceEnv VM_Location
If "%VM_ServerFunction%" <> "000" Then "Set:Worker" EndIf
-ReplaceEnv VM_Location
-ReplaceEnv VM_FarmName
[Set:Worker]
If "%VM_InstallManually%" = "True" Then "Set:ChangeMode1" EndIf
#Set:Product
#Set:Installation, DONTDELETE
#Set:Deinstallation, DELETE
#Reg:OnUninstallProduct, DELETE
#Reg:Product
#Ini:Product
#Security:Product
;#Set:AppSetup
If "%VM_InstallManually%" = "True" Then "Set:ChangeMode2" EndIf
;#Set:DisplayIcon
[Set:Product]
;AskKillProcesses <seconds>, <label1>, <label2>
If DoesRegKeyExist ("HKLM,SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\%VM_UninstallKey%,UnInstallString") == "1" Then "Set:Repair" EndIf
[Set:Installation]
AddMeter 55
Call "%Src%\{UnattInst}" {UnattInstPar}
If DoesRegKeyExist ("HKLM,SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\%VM_UninstallKey%,UnInstallString") == "0" Then "Set:InstallationError" EndIf
;If %ErrorLevel% <> "0" Then "Set:InstallationError" EndIf
[Set:Repair]
AddMeter 25
Call "%Src%\{UnattDeInst}" {UnattDeInstPar}
If DoesRegKeyExist ("HKLM,SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\%VM_UninstallKey%,UnInstallString") == "1" Then "Set:RepairError" EndIf
;If %ErrorLevel% <> "0" Then "Set:InstallationError" EndIf
[Set:Deinstallation]
If DoesRegKeyExist ("HKLM,SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\%VM_UninstallKey%,UnInstallString") == "1" Then "Set:Uninstallation" EndIf
[Set:Uninstallation]
;If %ErrorLevel% <> "0" Then "Set:UninstallationError" EndIf
If DoesRegKeyExist ("HKLM,SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\%VM_UninstallKey%,UnInstallString") == "1" Then "Set:UninstallationError" EndIf
-Call "%Src%\{UnattDeInst}" {UnattDeInstPar}
-AddMeter 50
;-AskKillProcesses <seconds>, <label1>, <label2>
[Reg:OnUninstallProduct]
[Reg:Product]
HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\%VM_UninstallKey%","SystemComponent",0x00010001,1
[Ini:Product]
[Security:Product]
[Shell:Product]
[Set:InstallationError]
ErrorLogMsg %ErrorText% %ErrorLevel% %CallingText% {UnattInst}
Abort
[Set:RepairError]
ErrorLogMsg %ErrorText% %ErrorLevel% %CallingText% {UnattInst}
Abort
[Set:UninstallationError]
-Abort
-ErrorLogMsg %ErrorText% %ErrorLevel% %CallingText% {UnattDeInst}
; ###########################################################################################################
[Set:AppSetup]
If DoesFileExist ("%VM__AppSetupFile%") == "1" Then "Set:AppSetupChange" EndIf
[Set:AppSetupChange]
#Set:InstallAppSetupCheck, DONTDELETE
#Set:UninstallAppSetup, DELETE
; -----------------------------------------------------------------------------------------------------------
[Set:InstallAppSetupCheck]
If DoesTextInFileExist ("%VM__AppSetupExecutableValue%", "%VM__AppSetupFile%") == "0" Then "Set:InstallAppSetup" EndIf
[Set:InstallAppSetup]
MkDir "%App%\UserFiles"
CallHidden CMD.EXE /C xcopy /E /H /Y "%Src%\UserFiles" "%App%\UserFiles\"
ReplaceTextFile ("%App%\UserFiles\Install.inf", "SubstituteApplicationDir", "%App%", 0)
ReplaceTextFile ("%App%\UserFiles\Install.inf", "SubstituteProduct", "%ProductName%", 0)
ReplaceTextFile ("%App%\UserFiles\Install.inf", "SubstituteDeveloper", "%DeveloperName%", 0)
ReplaceTextFile ("%App%\UserFiles\Install.inf", "SubstituteVersion", "%Version%", 0)
Set VM_PlatForm=%%%Src%\Install\Setup.inf,Setup,Platform%%
ReplaceEnv VM_PlatForm
ReplaceTextFile ("%App%\UserFiles\Install.inf", "SubstitutePlatform", "%VM_PlatForm%", 0)
Set VM_AppSetupNumber=%%%VM__AppSetupFile%,%VM__AppSetupNumberSection%,%VM__AppSetupNumber%%%
ReplaceEnv VM_AppSetupNumber
Increment (%VM_AppSetupNumber%,1)
#Ini:AppSetupInstall
[Ini:AppSetupInstall]
"%VM__AppSetupFile%","%VM__AppSetupNumberSection%",,"%VM__AppSetupNumber%=%VM_AppSetupNumber%"
"%VM__AppSetupFile%","%VM__AppSetupExecutableSection%",,"%VM__AppSetupExecutable%%VM_AppSetupNumber%=%VM__AppSetupExecutableValue%"
; -----------------------------------------------------------------------------------------------------------
; -----------------------------------------------------------------------------------------------------------
[Set:UninstallAppSetup]
If "%VM_ExecutableDeleted%" == "True" Then "Set:UninstallAppSetupCount" EndIf
For VM_AppSetupLoop, %VM_AppSetupNumber%, 1, -1, Set:AppSetupReadFile
-Set VM_ExecutableDeleted=False
-ReplaceEnv VM_AppSetupNumber
-Set VM_AppSetupNumber=%%%VM__AppSetupFile%,%VM__AppSetupNumberSection%,%VM__AppSetupNumber%%%
-DelTree "%App%\UserFiles"
[Set:UninstallAppSetupCount]
#Ini:UninstallAppSetupCount, DELETE
-Decrement (%VM_AppSetupNumber%,1)
[Set:AppSetupReadFile]
;If "%VM_ExecutableFromFile%" <> "%VM__AppSetupExecutableValue%" & "%VM_ExecutableDeleted%" == "True" & "%VM_AppSetupLoop%" <> "%VM_AppSetupNumber%" Then "Set:ChangeExecutableNumber" EndIf
If "%VM_ExecutableFromFile%" <> "%VM__AppSetupExecutableValue%" & "%VM_ExecutableDeleted%" == "True" Then "Set:ChangeExecutableNumber" EndIf
If "%VM_ExecutableFromFile%" == "%VM__AppSetupExecutableValue%" Then "Set:AppSetupDeleteExecutable" EndIf
-ReplaceEnv VM_ExecutableFromFile
-Set VM_ExecutableFromFile=%%%VM__AppSetupFile%,%VM__AppSetupExecutableSection%,%VM__AppSetupExecutable%%VM_AppSetupLoop%%%
[Set:AppSetupDeleteExecutable]
#Ini:AppSetupDeleteExecutable
-Set VM_ExecutableDeleted=True
[Ini:AppSetupDeleteExecutable]
"%VM__AppSetupFile%","%VM__AppSetupExecutableSection%",,"%VM__AppSetupExecutable%%VM_AppSetupLoop%="
[Set:ChangeExecutableNumber]
#Ini:ChangeExecutableNumberWrite, DELETE
#Ini:ChangeExecutableNumberDelete
-Decrement (%VM_NewNumber%,1)
-Set VM_NewNumber=%VM_AppSetupLoop%
[Ini:ChangeExecutableNumberDelete]
"%VM__AppSetupFile%","%VM__AppSetupExecutableSection%",,"%VM__AppSetupExecutable%%VM_AppSetupLoop%="
[Ini:ChangeExecutableNumberWrite]
"%VM__AppSetupFile%","%VM__AppSetupExecutableSection%",,"%VM__AppSetupExecutable%%VM_NewNumber%=%VM_ExecutableFromFile%"
[Ini:UninstallAppSetupCount]
"%VM__AppSetupFile%","%VM__AppSetupNumberSection%",,"%VM__AppSetupNumber%=%VM_AppSetupNumber%"
; -----------------------------------------------------------------------------------------------------------
; ###########################################################################################################
; ###########################################################################################################
[Set:DisplayIcon]
If DoesFileExist ("%Src%\Install\%VM_DisplayIcon%") == "1" Then "Set:InstallIcon" EndIf
[Set:InstallIcon]
Copy "%Src%\Install\%VM_DisplayIcon%" "%App%"
#Reg:InstallIcon
-Del "%App%\%VM_DisplayIcon%"
[Reg:InstallIcon]
HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\%DeveloperName% %ProductName% %Version%","DisplayIcon",0x00000000,"%App%\%VM_DisplayIcon%"
; ###########################################################################################################
; ###########################################################################################################
[Set:ChangeMode1]
CallHidden CMD.EXE /C Change User /Install
-CallHidden CMD.EXE /C Change User /Execute
[Set:ChangeMode2]
-CallHidden CMD.EXE /C Change User /Install
CallHidden CMD.EXE /C Change User /Execute
; ###########################################################################################################
Gruß
The Prosian