update to new opsi builder

This commit is contained in:
Mario Fetka 2013-03-10 18:51:49 +01:00
parent a974b5da0c
commit fdb25cb9a6
6 changed files with 123 additions and 39 deletions

View File

@ -1,16 +1,33 @@
; Copyright (c) uib gmbh (www.uib.de) ; Copyright (c) uib gmbh (www.uib.de)
; This sourcecode is owned by uib gmbh ; This sourcecode is owned by uib gmbh
; and published under the Terms of the General Public License. ; 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$ + "\Uninstall.exe" Set $UninstallProgram32$ = $InstallDir32$ + "\uninstall.exe"
Set $UninstallProgramOld32$ = $InstallDir32$ + "\" + $UninstallProg32$
Set $IniFile32$ = $InstallDir32$ + "\opsi-" + $ProductId$ + ".ini"
Set $UninstallProgram64$ = $InstallDir64$ + "\Uninstall.exe" Set $UninstallProgram64$ = $InstallDir64$ + "\uninstall.exe"
Set $UninstallProgramOld64$ = $InstallDir64$ + "\" + $UninstallProg64$
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") 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 $UninstallProgramOld32$ = GetValueFromInifile($IniFile$,"X86","UninstallProg32","XXXXXXXX.exe")
if FileExists($UninstallProgramOld32$)
comment "Uninstall program found, starting uninstall"
Winbatch_uninstall_old_32
sub_check_exitcode
endif
endif
if FileExists($UninstallProgram32$) if FileExists($UninstallProgram32$)
comment "Uninstall program found, starting uninstall" comment "Uninstall program found, starting uninstall"
Winbatch_uninstall_32 Winbatch_uninstall_32
@ -24,8 +41,21 @@ if (($INST_SystemType$ = "x86 System") and ($INST_architecture$ = "system specif
endif endif
if ($INST_SystemType$ = "64 Bit System") and (($INST_architecture$ = "system specific") or ($INST_architecture$ = "both") or ($INST_architecture$ = "64 only")) 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 $UninstallProgramOld64$ = GetValueFromInifile($IniFile$,"X86_64","UninstallProg64","XXXXXXXX.exe")
if FileExists($UninstallProgramOld64$)
comment "Uninstall program found, starting uninstall"
Winbatch_uninstall_old_64
sub_check_exitcode
endif
endif
if FileExists($UninstallProgram64$) if FileExists($UninstallProgram64$)
comment "Uninstall program found, starting uninstall" comment "Uninstall program found, starting uninstall"
Winbatch_uninstall_64 Winbatch_uninstall_64
@ -41,35 +71,27 @@ endif
comment "Delete program shortcuts" comment "Delete program shortcuts"
LinkFolder_uninstall LinkFolder_uninstall
[Winbatch_uninstall_32] [Winbatch_uninstall_old_32]
; Choose one of the following examples as basis for program uninstall "$UninstallProgramOld32$" /S
;
; === Nullsoft Scriptable Install System ================================================================
"$UninstallProgram32$" /S
;
; === Inno Setup ========================================================================================
; "$UninstallProgram32$" /silent /norestart /SUPPRESSMSGBOXES
[Winbatch_uninstall_32]
"$UninstallProgram32$" /S
[Files_uninstall_32] [Files_uninstall_32]
; Example for recursively deleting the installation directory (don't forget the trailing backslash): ; Example for recursively deleting the installation directory (don't forget the trailing backslash):
; ;
; delete -sf "$InstallDir32$\" delete -sf "$InstallDir32$\"
[Winbatch_uninstall_old_64]
"$UninstallProgramOld64$" /S
[Winbatch_uninstall_64] [Winbatch_uninstall_64]
; Choose one of the following examples as basis for program uninstall
;
; === Nullsoft Scriptable Install System ================================================================
"$UninstallProgram64$" /S "$UninstallProgram64$" /S
;
; === Inno Setup ========================================================================================
; "$UninstallProgram64$" /silent /norestart /SUPPRESSMSGBOXES
[Files_uninstall_64] [Files_uninstall_64]
; Example for recursively deleting the installation directory (don't forget the trailing backslash): ; Example for recursively deleting the installation directory:
; ;
; delete -sf "$InstallDir64$\" del -sf "$InstallDir64$\"
[Registry_uninstall] [Registry_uninstall]
; Example of deleting a registry key: ; 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,13 +1,18 @@
; Copyright (c) uib gmbh (www.uib.de) ; Copyright (c) uib gmbh (www.uib.de)
; This sourcecode is owned by uib ; This sourcecode is owned by uib
; and published under the Terms of the General Public License. ; and published under the Terms of the General Public License.
; credits: http://www.opsi.org/credits/ ; credits: http://www.opsi.org/en/credits/
[Actions] [Actions]
requiredWinstVersion >= "4.10.8.6" requiredWinstVersion >= "4.11.2.6"
DefVar $UninstallProgram32$ DefVar $UninstallProgram32$
DefVar $UninstallProgramOld32$
DefVar $IniFile32$
DefVar $UninstallProgram64$ DefVar $UninstallProgram64$
DefVar $UninstallProgramOld64$
DefVar $IniFile64$
DefVar $IniCfgFile$
DefVar $LogDir$ DefVar $LogDir$
DefVar $ProductId$ DefVar $ProductId$
DefVar $MinimumSpace$ DefVar $MinimumSpace$
@ -16,11 +21,13 @@ DefVar $InstallDir64$
DefVar $ExitCode$ DefVar $ExitCode$
DefVar $INST_SystemType$ DefVar $INST_SystemType$
DefVar $INST_architecture$ DefVar $INST_architecture$
DefVar $OLD_VERSION$
DefVar $OLD_CREATOR_TAG$
DefVar $OLD_RELEASE$
Set $INST_SystemType$ = GetSystemType Set $INST_SystemType$ = GetSystemType
set $INST_architecture$ = GetProductProperty("install_architecture","system specific") set $INST_architecture$ = GetProductProperty("install_architecture","system specific")
Set $LogDir$ = "%SystemDrive%\tmp" Set $LogDir$ = "%SystemDrive%\tmp"
; The token BUILDER_VARIABLES will be replaced by opsi-builder.sh ; The token BUILDER_VARIABLES will be replaced by opsi-builder.sh
@ -39,20 +46,21 @@ Set $LogDir$ = "%SystemDrive%\tmp"
;$ProductId$ should be the name of the product in opsi ;$ProductId$ should be the name of the product in opsi
; therefore please: only lower letters, no umlauts, ; therefore please: only lower letters, no umlauts,
; no white space use '-' as a seperator ; no white space use '-' as a seperator
Set $ProductId$ = "autoit.script"
Set $MinimumSpace$ = "15 MB" Set $MinimumSpace$ = "15 MB"
; the path were we find the product after the installation ; the path were we find the product after the installation
Set $InstallDir32$ = "%ProgramFiles32Dir%\AutoIt3" Set $InstallDir32$ = "%ProgramFiles32Dir%\AutoIt3"
Set $InstallDir64$ = "%ProgramFiles64Dir%\AutoIt3" Set $InstallDir64$ = "%ProgramFiles64Dir%\AutoIt3"
; ---------------------------------------------------------------- ; ----------------------------------------------------------------
Set $IniCfgFile$ = "%ScriptPath%\opsi-" + $ProductId$ + ".ini"
if not(HasMinimumSpace ("%SystemDrive%", $MinimumSpace$)) if not(HasMinimumSpace ("%SystemDrive%", $MinimumSpace$))
LogError "Not enough space on %SystemDrive%, " + $MinimumSpace$ + " on drive %SystemDrive% needed for " + $ProductId$ LogError "Not enough space on %SystemDrive%, " + $MinimumSpace$ + " on drive %SystemDrive% needed for " + $ProductId$
isFatalError isFatalError
; Stop process and set installation status to failed ; Stop process and set installation status to failed
else else
comment "Show product picture" comment "Show product picture"
ShowBitmap "%ScriptPath%\" + $ProductId$ + ".png" $ProductId$ ShowBitmap "%ScriptPath%\" + $ProductId$ + ".png" $NAME$
if FileExists("%ScriptPath%\delsub3264.ins") if FileExists("%ScriptPath%\delsub3264.ins")
comment "Start uninstall sub section" comment "Start uninstall sub section"
@ -62,8 +70,9 @@ else
comment "installing" comment "installing"
if (($INST_SystemType$ = "x86 System") and ($INST_architecture$ = "system specific")) or ($INST_architecture$ = "both") or ($INST_architecture$ = "32 only") 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" comment "Start setup program"
ChangeDirectory "%SCRIPTPATH%"
Winbatch_install_32 Winbatch_install_32
Sub_check_exitcode Sub_check_exitcode
comment "Copy files" comment "Copy files"
@ -75,8 +84,9 @@ else
endif endif
if ($INST_SystemType$ = "64 Bit System") and (($INST_architecture$ = "system specific") or ($INST_architecture$ = "both") or ($INST_architecture$ = "64 only")) 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" comment "Start setup program"
ChangeDirectory "%SCRIPTPATH%"
Winbatch_install_64 Winbatch_install_64
Sub_check_exitcode Sub_check_exitcode
comment "Copy files" comment "Copy files"
@ -93,6 +103,9 @@ endif
"$Install32Exe$" /S "$Install32Exe$" /S
[Files_install_32] [Files_install_32]
; copy the ini file to the InstallDir
copy "$IniCfgFile$" "$InstallDir32$"
; Example of recursively copying some files into the installation directory: ; Example of recursively copying some files into the installation directory:
; ;
; copy -s "%ScriptPath%\files\*.*" "$InstallDir32$" ; copy -s "%ScriptPath%\files\*.*" "$InstallDir32$"
@ -101,6 +114,9 @@ endif
"$Install64Exe$" /S "$Install64Exe$" /S
[Files_install_64] [Files_install_64]
; copy the ini file to the InstallDir
copy "$IniCfgFile$" "$InstallDir64$"
; Example of recursively copying some files into the installation directory: ; Example of recursively copying some files into the installation directory:
; ;
; copy -s "%ScriptPath%\files\*.*" "$InstallDir64$" ; copy -s "%ScriptPath%\files\*.*" "$InstallDir64$"

View File

@ -1,13 +1,18 @@
; Copyright (c) uib gmbh (www.uib.de) ; Copyright (c) uib gmbh (www.uib.de)
; This sourcecode is owned by uib gmbh ; This sourcecode is owned by uib gmbh
; and published under the Terms of the General Public License. ; and published under the Terms of the General Public License.
; credits: http://www.opsi.org/credits/ ; credits: http://www.opsi.org/en/credits/
[Actions] [Actions]
requiredWinstVersion >= "4.10.8.6" requiredWinstVersion >= "4.11.2.6"
DefVar $UninstallProgram32$ DefVar $UninstallProgram32$
DefVar $UninstallProgramOld32$
DefVar $IniFile32$
DefVar $UninstallProgram64$ DefVar $UninstallProgram64$
DefVar $UninstallProgramOld64$
DefVar $IniFile64$
DefVar $IniCfgFile$
DefVar $LogDir$ DefVar $LogDir$
DefVar $ExitCode$ DefVar $ExitCode$
DefVar $ProductId$ DefVar $ProductId$
@ -15,11 +20,13 @@ DefVar $InstallDir32$
DefVar $InstallDir64$ DefVar $InstallDir64$
DefVar $INST_SystemType$ DefVar $INST_SystemType$
DefVar $INST_architecture$ DefVar $INST_architecture$
DefVar $OLD_VERSION$
DefVar $OLD_CREATOR_TAG$
DefVar $OLD_RELEASE$
Set $INST_SystemType$ = GetSystemType Set $INST_SystemType$ = GetSystemType
set $INST_architecture$ = GetProductProperty("install_architecture","system specific") set $INST_architecture$ = GetProductProperty("install_architecture","system specific")
Set $LogDir$ = "%SystemDrive%\tmp" Set $LogDir$ = "%SystemDrive%\tmp"
; The token BUILDER_VARIABLES will be replaced by opsi-builder.sh ; The token BUILDER_VARIABLES will be replaced by opsi-builder.sh
@ -35,18 +42,19 @@ Set $LogDir$ = "%SystemDrive%\tmp"
; ---------------------------------------------------------------- ; ----------------------------------------------------------------
; - Please edit the following values - ; - Please edit the following values -
; ---------------------------------------------------------------- ; ----------------------------------------------------------------
Set $ProductId$ = "autoit.script"
Set $InstallDir32$ = "%ProgramFiles32Dir%\AutoIt3" Set $InstallDir32$ = "%ProgramFiles32Dir%\AutoIt3"
Set $InstallDir64$ = "%ProgramFiles64Dir%\AutoIt3" Set $InstallDir64$ = "%ProgramFiles64Dir%\AutoIt3"
; ---------------------------------------------------------------- ; ----------------------------------------------------------------
Set $IniCfgFile$ = "%ScriptPath%\opsi-" + $ProductId$ + ".ini"
comment "Show product picture" comment "Show product picture"
ShowBitmap "%ScriptPath%\" + $ProductId$ + ".png" $ProductId$ ShowBitmap "%ScriptPath%\" + $ProductId$ + ".png" $NAME$
Message "Uninstalling " + $ProductId$ + " ..." Message "Uninstalling " + $ProductId$ + " ..."
if FileExists("%ScriptPath%\delsub3264.ins") if FileExists("%ScriptPath%\delsub3264.ins")
comment "Start uninstall sub section" comment "Start uninstall sub section"
Sub "%ScriptPath%\delsub3264.ins" Sub "%ScriptPath%\delsub3264.ins"
endif endif

View File

@ -3,7 +3,7 @@
############################ ############################
VENDOR="autoitscript.com" VENDOR="autoitscript.com"
PN="autoit.script" PN="autoit.script"
NAME="AutoIt" NAME="AutoIt v3"
DESCRIPTION="AutoIt v3 is a freeware BASIC-like scripting language designed for automating the Windows GUI and general scripting." DESCRIPTION="AutoIt v3 is a freeware BASIC-like scripting language designed for automating the Windows GUI and general scripting."
VERSION="3.3.8.1" VERSION="3.3.8.1"
RELEASE="1" RELEASE="1"
@ -20,16 +20,23 @@ DL_SOURCE[0]="http://fc09.deviantart.net/fs71/f/2011/323/3/8/autoit_icon_by_cacg
DL_FILE[1]="autoit-v3-setup-$VERSION.exe" DL_FILE[1]="autoit-v3-setup-$VERSION.exe"
DL_SOURCE[1]="http://www.autoitscript.com/files/autoit3/autoit-v3-setup.exe" DL_SOURCE[1]="http://www.autoitscript.com/files/autoit3/autoit-v3-setup.exe"
#DL_SOURCE[1]="http://www.autoitscript.com/autoit3/files/beta/autoit/autoit-v3.3.9.4-beta-setup.exe"
DL_ARCH[1]="X86" DL_ARCH[1]="X86"
DL_WINST_NAME[1]=Install32Exe DL_WINST_NAME[1]=Install32Exe
DL_FILE[2]="autoit-v3-setup-$VERSION.exe" DL_FILE[2]="autoit-v3-setup-$VERSION.exe"
DL_SOURCE[2]="http://www.autoitscript.com/files/autoit3/autoit-v3-setup.exe" DL_SOURCE[2]="http://www.autoitscript.com/files/autoit3/autoit-v3-setup.exe"
#DL_SOURCE[1]="http://www.autoitscript.com/autoit3/files/beta/autoit/autoit-v3.3.9.4-beta-setup.exe"
DL_ARCH[2]="X86_64" DL_ARCH[2]="X86_64"
DL_WINST_NAME[2]=Install64Exe DL_WINST_NAME[2]=Install64Exe
# File array index for the image showing while installing the program # File array index for the image showing while installing the program
ICON_DL_INDEX=0 ICON_DL_INDEX=0
OPSI_INI_SECTION[0]="X86"
OPSI_INI_OPTION[0]="UninstallProg32"
OPSI_INI_VALUE[0]="Uninstall.exe"
OPSI_INI_SECTION[1]="X86_64"
OPSI_INI_OPTION[1]="UninstallProg64"
OPSI_INI_VALUE[1]="Uninstall.exe"