correct installer variable

This commit is contained in:
Mario Fetka 2013-03-13 19:36:28 +01:00
parent 78b8e70140
commit 75f221b001
7 changed files with 170 additions and 34 deletions

View File

@ -1,23 +1,71 @@
; Copyright (c) uib gmbh (www.uib.de)
; This sourcecode is owned by uib gmbh
; and published under the Terms of the General Public License.
; credits: http://www.opsi.org/credits/
; credits: http://www.opsi.org/en/credits/
Set $UninstallProgram32$ = $InstallDir32$ + $UninstallProg32$
Set $Uninstall2Program32$ = $InstallDir32$ + $Uninstall2Prog32$
Set $IniFile32$ = $InstallDir32$ + "\opsi-" + $ProductId$ + ".ini"
Set $UninstallProgram64$ = $InstallDir64$ + $UninstallProg64$
Set $Uninstall2Program64$ = $InstallDir64$ + $Uninstall2Prog64$
Set $IniFile64$ = $InstallDir64$ + "\opsi-" + $ProductId$ + ".ini"
if (($INST_SystemType$ = "x86 System") and ($INST_architecture$ = "system specific")) or ($INST_architecture$ = "both") or ($INST_architecture$ = "32 only")
Message "Uninstalling " + $ProductId$ + " 32 Bit..."
if FileExists($IniFile32$)
Set $OLD_VERSION$ = GetValueFromInifile($IniFile32$,"COMMON","VERSION","")
Set $OLD_CREATOR_TAG$ = GetValueFromInifile($IniFile32$,"COMMON","CREATOR_TAG","")
Set $OLD_RELEASE$ = GetValueFromInifile($IniFile32$,"COMMON","RELEASE","")
endif
Message "Uninstalling " + $ProductId$ + " "+ $OLD_VERSION$ + "-" + $OLD_CREATOR_TAG$ + $OLD_RELEASE$ + " 32 Bit..."
if FileExists($IniFile32$)
Set $UninstallProg32$ = GetValueFromInifile($IniFile32$,"X86","UninstallProg32","XXXXXXXX.exe")
Set $Uninstall2Prog32$ = GetValueFromInifile($IniFile32$,"X86","Uninstall2Prog32","XXXXXXXX.exe")
Set $UninstallProgramOld32$ = $InstallDir32$ + "\" + $UninstallProg32$
Set $Uninstall2ProgramOld32$ = $InstallDir32$ + "\" + $Uninstall2Prog32$
if FileExists($UninstallProgramOld32$)
comment "Uninstall program found, starting uninstall"
Files_uninstall_old_32
sub_check_exitcode
endif
endif
if FileExists($UninstallProgram32$)
comment "Uninstall program found, starting uninstall"
Files_uninstall_32
sub_check_exitcode
endif
comment "Delete files"
Files_uninstall_32 /32Bit
comment "Cleanup registry"
Registry_uninstall /32Bit
endif
if ($INST_SystemType$ = "64 Bit System") and (($INST_architecture$ = "system specific") or ($INST_architecture$ = "both") or ($INST_architecture$ = "64 only"))
Message "Uninstalling " + $ProductId$ + " 64 Bit..."
if FileExists($IniFile64$)
Set $OLD_VERSION$ = GetValueFromInifile($IniFile64$,"COMMON","VERSION","")
Set $OLD_CREATOR_TAG$ = GetValueFromInifile($IniFile64$,"COMMON","CREATOR_TAG","")
Set $OLD_RELEASE$ = GetValueFromInifile($IniFile64$,"COMMON","RELEASE","")
endif
Message "Uninstalling " + $ProductId$ + " "+ $OLD_VERSION$ + "-" + $OLD_CREATOR_TAG$ + $OLD_RELEASE$ + " 64 Bit..."
if FileExists($IniFile64$)
Set $UninstallProg64$ = GetValueFromInifile($IniFile64$,"X86_64","UninstallProg64","XXXXXXXX.exe")
Set $Uninstall2Prog64$ = GetValueFromInifile($IniFile64$,"X86_64","Uninstall2Prog64","XXXXXXXX.exe")
Set $UninstallProgramOld64$ = $InstallDir64$ + "\" + $UninstallProg64$
Set $Uninstall2ProgramOld64$ = $InstallDir64$ + "\" + $Uninstall2Prog64$
if FileExists($UninstallProgramOld64$)
comment "Uninstall program found, starting uninstall"
Files_uninstall_old_64
sub_check_exitcode
endif
endif
if FileExists($UninstallProgram64$)
comment "Uninstall program found, starting uninstall"
Files_uninstall_64
sub_check_exitcode
endif
comment "Delete files"
Files_uninstall_64 /64Bit
comment "Cleanup registry"
Registry_uninstall /64Bit
endif
@ -25,13 +73,21 @@ endif
comment "Delete program shortcuts"
LinkFolder_uninstall
[Files_uninstall_old_32]
delete -sf "$UninstallProgramOld32$"
delete -sf "$Uninstall2ProgramOld32$"
[Files_uninstall_32]
delete -sf "$InstallDir32$\runinf.exe"
delete -sf "$InstallDir32$\LaunchINFSectionEx.exe"
delete -sf "$UninstallProgram32$"
delete -sf "$Uninstall2Program32$"
[Files_uninstall_old_64]
delete -sf "$UninstallProgramOld64$"
delete -sf "$Uninstall2ProgramOld64$"
[Files_uninstall_64]
delete -sf "$InstallDir64$\runinf.exe"
delete -sf "$InstallDir64$\LaunchINFSectionEx.exe"
delete -sf "$UninstallProgram64$"
delete -sf "$Uninstall2Program64$"
[Registry_uninstall]
; Example of deleting a registry key:

24
CLIENT_DATA/login.ins Normal file
View File

@ -0,0 +1,24 @@
; Copyright (c) uib gmbh (www.uib.de)
; This sourcecode is owned by uib gmbh
; and published under the Terms of the General Public License.
; credits: http://www.opsi.org/en/credits/
[Actions]
Message "Profile Patch for VLC ...."
comment "Did we run this script before ? - and set version stamp in profile"
if getValue("installationstate", getProductMap) = "installed"
comment "Product is installed"
if not (scriptWasExecutedBefore)
comment "loginscript was not run yet "
Files_profile_copy
Registry_currentuser_set
endif
endif
[Files_profile_copy]
copy "%Scriptpath%\profiles\*.*" "%CurrentAppdataDir%\ACME"
[Registry_currentuser_set]
openkey [HKCU\Software\ACME]
set "show_greeting_window" = "no"

View File

@ -0,0 +1,7 @@
[X86]
[X86_64]
[COMMON]
PN=name
VERSION=version

View File

@ -1,11 +1,18 @@
; Copyright (c) uib gmbh (www.uib.de)
; This sourcecode is owned by uib
; and published under the Terms of the General Public License.
; credits: http://www.opsi.org/credits/
; credits: http://www.opsi.org/en/credits/
[Actions]
requiredWinstVersion >= "4.10.8.6"
requiredWinstVersion >= "4.11.2.6"
DefVar $UninstallProgram32$
DefVar $UninstallProgramOld32$
DefVar $IniFile32$
DefVar $UninstallProgram64$
DefVar $UninstallProgramOld64$
DefVar $IniFile64$
DefVar $IniCfgFile$
DefVar $LogDir$
DefVar $ProductId$
DefVar $MinimumSpace$
@ -14,11 +21,13 @@ DefVar $InstallDir64$
DefVar $ExitCode$
DefVar $INST_SystemType$
DefVar $INST_architecture$
DefVar $OLD_VERSION$
DefVar $OLD_CREATOR_TAG$
DefVar $OLD_RELEASE$
Set $INST_SystemType$ = GetSystemType
set $INST_architecture$ = GetProductProperty("install_architecture","system specific")
Set $LogDir$ = "%SystemDrive%\tmp"
; The token BUILDER_VARIABLES will be replaced by opsi-builder.sh
@ -37,20 +46,21 @@ Set $LogDir$ = "%SystemDrive%\tmp"
;$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$ = "kliu.runinf"
Set $MinimumSpace$ = "1 MB"
; the path were we find the product after the installation
Set $InstallDir32$ = "%Systemroot%"
Set $InstallDir64$ = "%Systemroot%"
; ----------------------------------------------------------------
Set $IniCfgFile$ = "%ScriptPath%\opsi-" + $ProductId$ + ".ini"
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
comment "Show product picture"
ShowBitmap "%ScriptPath%\" + $ProductId$ + ".png" $ProductId$
ShowBitmap "%ScriptPath%\" + $ProductId$ + ".png" $NAME$
if FileExists("%ScriptPath%\delsub3264.ins")
comment "Start uninstall sub section"
@ -60,7 +70,9 @@ else
comment "installing"
if (($INST_SystemType$ = "x86 System") and ($INST_architecture$ = "system specific")) or ($INST_architecture$ = "both") or ($INST_architecture$ = "32 only")
Message "Installing " + $ProductId$ + " 32 Bit..."
Message "Installing " + $ProductId$ + " "+ $VERSION$ + "-" + $CREATOR_TAG$ + $RELEASE$ + " 32 Bit..."
comment "Start setup program"
ChangeDirectory "%SCRIPTPATH%"
comment "Copy files"
Files_install_32 /32Bit
comment "Patch Registry"
@ -70,7 +82,9 @@ else
endif
if ($INST_SystemType$ = "64 Bit System") and (($INST_architecture$ = "system specific") or ($INST_architecture$ = "both") or ($INST_architecture$ = "64 only"))
Message "Installing " + $ProductId$ + " 64 Bit..."
Message "Installing " + $ProductId$ + " "+ $VERSION$ + "-" + $CREATOR_TAG$ + $RELEASE$ + " 64 Bit..."
comment "Start setup program"
ChangeDirectory "%SCRIPTPATH%"
comment "Copy files"
Files_install_64 /64Bit
comment "Patch Registry"
@ -82,13 +96,16 @@ else
endif
[Files_install_32]
copy "$RunInf32Exe$" "$InstallDir32$"
copy "$LaunchInfSectionEx32Exe$" "$InstallDir32$"
; copy the ini file to the InstallDir
copy "$IniCfgFile$" "$InstallDir32$"
copy "$Install32Exe$" "$InstallDir32$"
copy "$Install32Exe2$" "$InstallDir32$"
[Files_install_64]
copy "$runinf64Exe$" "$InstallDir64$"
copy "$LaunchInfSectionEx64Exe$" "$InstallDir64$"
; copy the ini file to the InstallDir
copy "$IniCfgFile$" "$InstallDir64$"
copy "$install64Exe$" "$InstallDir64$"
copy "$install64Exe2$" "$InstallDir64$"
[Registry_install]
; Example of setting some values of an registry key:

View File

@ -1,25 +1,34 @@
; Copyright (c) uib gmbh (www.uib.de)
; This sourcecode is owned by uib gmbh
; and published under the Terms of the General Public License.
; credits: http://www.opsi.org/credits/
; credits: http://www.opsi.org/en/credits/
[Actions]
requiredWinstVersion >= "4.10.8.6"
requiredWinstVersion >= "4.11.2.6"
DefVar $UninstallProg32$
DefVar $UninstallProgram32$
DefVar $UninstallProgramOld32$
DefVar $IniFile32$
DefVar $UninstallProg64$
DefVar $UninstallProgram64$
DefVar $UninstallProgramOld64$
DefVar $IniFile64$
DefVar $IniCfgFile$
DefVar $LogDir$
DefVar $ExitCode$
DefVar $ProductId$
DefVar $InstallDir32$
DefVar $InstallDir64$
DefVar $LicenseRequired$
DefVar $LicensePool$
DefVar $INST_SystemType$
DefVar $INST_architecture$
DefVar $OLD_VERSION$
DefVar $OLD_CREATOR_TAG$
DefVar $OLD_RELEASE$
Set $INST_SystemType$ = GetSystemType
set $INST_architecture$ = GetProductProperty("install_architecture","system specific")
Set $LogDir$ = "%SystemDrive%\tmp"
; The token BUILDER_VARIABLES will be replaced by opsi-builder.sh
@ -35,14 +44,14 @@ Set $LogDir$ = "%SystemDrive%\tmp"
; ----------------------------------------------------------------
; - Please edit the following values -
; ----------------------------------------------------------------
Set $ProductId$ = "kliu.runinf"
Set $InstallDir32$ = "%Systemroot%"
Set $InstallDir64$ = "%Systemroot%"
; ----------------------------------------------------------------
Set $IniCfgFile$ = "%ScriptPath%\opsi-" + $ProductId$ + ".ini"
comment "Show product picture"
ShowBitmap "%ScriptPath%\" + $ProductId$ + ".png" $ProductId$
ShowBitmap "%ScriptPath%\" + $ProductId$ + ".png" $NAME$
Message "Uninstalling " + $ProductId$ + " ..."

View File

@ -3,6 +3,8 @@
############################
VENDOR="code.kliu.org"
PN="kliu.runinf"
NAME="Kliu INF Launcher"
DESCRIPTION="light-weight INF launcher; useful for ensuring the correct Wow64 translation behavior"
VERSION="1.2.0"
RELEASE="3"
PRIORITY="0"
@ -24,14 +26,29 @@ DL_EXTRACT_FORMAT[1]="7zip"
# File array index for the image showing while installing the program
ICON_DL_INDEX=0
WINST_NAME[0]="RunInf32Exe"
WINST_NAME[0]="Install32Exe"
WINST_VALUE[0]="@DL_EXTRACT_WINST_PATH[1]@\\bin.x86-32\\runinf.exe"
WINST_NAME[1]="LaunchInfSectionEx32Exe"
WINST_NAME[1]="Install32Exe2"
WINST_VALUE[1]="@DL_EXTRACT_WINST_PATH[1]@\\bin.x86-32\\LaunchINFSectionEx.exe"
WINST_NAME[2]="RunInf64Exe"
WINST_NAME[2]="Install64Exe"
WINST_VALUE[2]="@DL_EXTRACT_WINST_PATH[1]@\\bin.x86-64\\runinf.exe"
WINST_NAME[3]="LaunchInfSectionEx64Exe"
WINST_NAME[3]="Install64Exe2"
WINST_VALUE[3]="@DL_EXTRACT_WINST_PATH[1]@\\bin.x86-64\\LaunchINFSectionEx.exe"
OPSI_INI_SECTION[0]="X86"
OPSI_INI_OPTION[0]="UninstallProg32"
OPSI_INI_VALUE[0]="runinf.exe"
OPSI_INI_SECTION[1]="X86_64"
OPSI_INI_OPTION[1]="UninstallProg64"
OPSI_INI_VALUE[1]="runinf.exe"
OPSI_INI_SECTION[2]="X86"
OPSI_INI_OPTION[2]="Uninstall2Prog32"
OPSI_INI_VALUE[2]="LaunchINFSectionEx.exe"
OPSI_INI_SECTION[3]="X86_64"
OPSI_INI_OPTION[3]="Uninstall2Prog64"
OPSI_INI_VALUE[3]="LaunchINFSectionEx.exe"

View File

@ -23,3 +23,9 @@ function cleanup() {
echo "Cleanup"
builder_cleanup
}
function create() {
echo "Create"
builder_create
rm -rf $INST_DIR/CLIENT_DATA/X86/src
}