intial commit waterfox with nsis installer
This commit is contained in:
5
CLIENT_DATA/defaultassociations.xml
Normal file
5
CLIENT_DATA/defaultassociations.xml
Normal file
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<DefaultAssociations>
|
||||
<Association Identifier="http" ProgId="WaterfoxURL" ApplicationName="Waterfox" />
|
||||
<Association Identifier="https" ProgId="WaterfoxURL" ApplicationName="Waterfox" />
|
||||
</DefaultAssociations>
|
||||
@@ -4,43 +4,45 @@
|
||||
; credits: http://www.opsi.org/en/credits/
|
||||
|
||||
|
||||
Set $UninstallProgram$ = $InstallDir$ + "\" + $UninstallProg$
|
||||
Set $IniFile$ = $InstallDir$ + "\opsi-" + $ProductId$ + ".ini"
|
||||
|
||||
if FileExists($IniFile$)
|
||||
Set $OLD_VERSION$ = GetValueFromInifile($IniFile$,"COMMON","VERSION","")
|
||||
Set $OLD_CREATOR_TAG$ = GetValueFromInifile($IniFile$,"COMMON","CREATOR_TAG","")
|
||||
Set $OLD_RELEASE$ = GetValueFromInifile($IniFile$,"COMMON","RELEASE","")
|
||||
Set $OLD_VERSION$ = GetValueFromInifile($IniFile$,"COMMON","VERSION","")
|
||||
Set $OLD_CREATOR_TAG$ = GetValueFromInifile($IniFile$,"COMMON","CREATOR_TAG","")
|
||||
Set $OLD_RELEASE$ = GetValueFromInifile($IniFile$,"COMMON","RELEASE","")
|
||||
endif
|
||||
Message "Uninstalling " + $ProductId$ + " "+ $OLD_VERSION$ + "-" + $OLD_CREATOR_TAG$ + $OLD_RELEASE$ + " ..."
|
||||
Message "Uninstalling " + $ProductId$ + " " + $OLD_VERSION$ + "-" + $OLD_CREATOR_TAG$ + $OLD_RELEASE$ + " ..."
|
||||
|
||||
if FileExists($IniFile$)
|
||||
Set $MsiIdOld$ = GetValueFromInifile($IniFile$,"X86_64","MsiId","{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}")
|
||||
if not (GetRegistryStringValue32("[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\" + $MsiIdOld$ + "] DisplayName") = "")
|
||||
comment "Old MSI id " + $MsiIdOld$ + " found in registry, starting msiexec to uninstall old version"
|
||||
Winbatch_uninstall_msi_old
|
||||
sub_check_exitcode
|
||||
endif
|
||||
Set $UninstallProg$ = GetValueFromInifile($IniFile$,"X86","UninstallProg","XXXXXXXX.exe")
|
||||
Set $UninstallProgramOld$ = $InstallDir$ + "\" + $UninstallProg$
|
||||
if FileExists($UninstallProgramOld$)
|
||||
comment "Uninstall program found, starting uninstall"
|
||||
Winbatch_uninstall_old /WaitforProcessending "Au_.exe" /Timeoutseconds 20
|
||||
sub_check_exitcode
|
||||
endif
|
||||
endif
|
||||
if not (GetRegistryStringValue64("[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\" + $MsiId$ + "] DisplayName") = "")
|
||||
comment "MSI id " + $MsiId$ + " found in registry, starting msiexec to uninstall"
|
||||
Winbatch_uninstall_msi
|
||||
if FileExists($UninstallProgram$)
|
||||
comment "Uninstall program found, starting uninstall"
|
||||
Winbatch_uninstall /WaitforProcessending "Au_.exe" /Timeoutseconds 20
|
||||
sub_check_exitcode
|
||||
endif
|
||||
|
||||
comment "Delete files"
|
||||
Files_uninstall /64Bit
|
||||
Files_uninstall /64bit
|
||||
|
||||
comment "Cleanup registry"
|
||||
Registry_uninstall /64Bit
|
||||
Registry_uninstall /64bit
|
||||
|
||||
comment "Delete program shortcuts"
|
||||
LinkFolder_uninstall
|
||||
|
||||
[Winbatch_uninstall_msi_old]
|
||||
msiexec /x $MsiIdOld$ /qb! REBOOT=ReallySuppress
|
||||
[Winbatch_uninstall_old]
|
||||
"$UninstallProgramOld$" -ms
|
||||
|
||||
[Winbatch_uninstall_msi]
|
||||
msiexec /x $MsiId$ /qb! REBOOT=ReallySuppress
|
||||
[Winbatch_uninstall]
|
||||
"$UninstallProgram$" -ms
|
||||
|
||||
[Files_uninstall]
|
||||
; Example for recursively deleting the installation directory:
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[X86_64]
|
||||
[X86]
|
||||
|
||||
[COMMON]
|
||||
PN=name
|
||||
|
||||
@@ -6,7 +6,8 @@
|
||||
[Actions]
|
||||
requiredWinstVersion >= "4.11.2.6"
|
||||
|
||||
DefVar $MsiIdOld$
|
||||
DefVar $UninstallProgram$
|
||||
DefVar $UninstallProgramOld$
|
||||
DefVar $IniFile$
|
||||
DefVar $IniCfgFile$
|
||||
DefVar $LogDir$
|
||||
@@ -17,7 +18,6 @@ DefVar $ExitCode$
|
||||
DefVar $OLD_VERSION$
|
||||
DefVar $OLD_CREATOR_TAG$
|
||||
DefVar $OLD_RELEASE$
|
||||
DefVar $RealInstallMsi$
|
||||
|
||||
; DefVar $InstallDir$
|
||||
DefVar $ProgExe$
|
||||
@@ -34,27 +34,22 @@ Set $LogDir$ = "%SystemDrive%\tmp"
|
||||
;
|
||||
@@BUILDER_VARIABLES@@
|
||||
|
||||
|
||||
|
||||
|
||||
; ----------------------------------------------------------------
|
||||
; - 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 $MinimumSpace$ = "100 MB"
|
||||
Set $MinimumSpace$ = "200 MB"
|
||||
; the path were we find the product after the installation
|
||||
Set $InstallDir$ = "%ProgramFiles64Dir%\Waterfox"
|
||||
Set $InstallDir$ = "%ProgramFiles64Dir%\Mozilla Waterfox"
|
||||
; ----------------------------------------------------------------
|
||||
|
||||
Set $RealInstallMsi$ = $LogDir$ + "\" + $ExtractDir$ + "\" + $InstallMsi$
|
||||
|
||||
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
|
||||
isFatalError "No Space"
|
||||
; Stop process and set installation status to failed
|
||||
else
|
||||
comment "Show product picture"
|
||||
@@ -65,20 +60,18 @@ else
|
||||
Sub "%ScriptPath%\delsub64.ins"
|
||||
endif
|
||||
|
||||
Message "Installing " + $ProductId$ + " ..."
|
||||
Message "Installing " + $ProductId$ + " "+ $VERSION$ + "-" + $CREATOR_TAG$ + $RELEASE$ + " ..."
|
||||
|
||||
comment "Start setup program"
|
||||
ChangeDirectory "%SCRIPTPATH%"
|
||||
Winbatch_extract
|
||||
Sub_check_exitcode
|
||||
Winbatch_install
|
||||
Sub_check_exitcode
|
||||
|
||||
comment create associations
|
||||
; Set $InstallDir$ = $InstallDir32$
|
||||
; Set $InstallDir$ = $InstallDir64$
|
||||
Set $ProgExe$ = $Prog64$
|
||||
DosInAnIcon_install winst /Sysnative
|
||||
|
||||
|
||||
comment "Copy files"
|
||||
Files_install /64Bit
|
||||
|
||||
@@ -87,7 +80,7 @@ else
|
||||
|
||||
comment "Create shortcuts"
|
||||
LinkFolder_install
|
||||
|
||||
|
||||
endif
|
||||
|
||||
[DosInAnIcon_install]
|
||||
@@ -118,7 +111,7 @@ FOR %%j IN (%Extn%) DO (
|
||||
copy "$LogDir$\defaultassociations.xml" "$LogDir$\defaultassociations.xml.old"
|
||||
xml ed -d /DefaultAssociations/Association[@Identifier='%%A'] "$LogDir$\defaultassociations.xml.old"> "$LogDir$\defaultassociations.xml"
|
||||
copy "$LogDir$\defaultassociations.xml" "$LogDir$\defaultassociations.xml.old"
|
||||
xml ed -s /DefaultAssociations -t elem -n Association_new -v "" -i /DefaultAssociations/Association_new -t attr -n Identifier -v %%A -i /DefaultAssociations/Association_new -t attr -n ProgId -v FirefoxURL -i /DefaultAssociations/Association_new -t attr -n ApplicationName -v "Waterfox" -r "/DefaultAssociations/Association_new" -v Association "$LogDir$\defaultassociations.xml.old"> "$LogDir$\defaultassociations.xml"
|
||||
xml ed -s /DefaultAssociations -t elem -n Association_new -v "" -i /DefaultAssociations/Association_new -t attr -n Identifier -v %%A -i /DefaultAssociations/Association_new -t attr -n ProgId -v WaterfoxURL -i /DefaultAssociations/Association_new -t attr -n ApplicationName -v "Waterfox" -r "/DefaultAssociations/Association_new" -v Association "$LogDir$\defaultassociations.xml.old"> "$LogDir$\defaultassociations.xml"
|
||||
)
|
||||
)
|
||||
|
||||
@@ -126,27 +119,18 @@ rem Set Default Associations for Windows 8
|
||||
move "$LogDir$\defaultassociations.xml" "%System%"
|
||||
REG ADD HKLM\Software\Policies\Microsoft\Windows\System /V DefaultAssociationsConfiguration /D "%System%\defaultassociations.xml" /F
|
||||
|
||||
rem Special case for Waterfox
|
||||
REG ADD %SC%\FirefoxURL\DefaultIcon /VE /D "$InstallDir$\%Prog%.exe,1" /F
|
||||
REG ADD %SC%\FirefoxURL\shell\open\command /VE /D "\"%InstallDir%\%Prog%.exe\" -osint -url \"%%1\"" /F
|
||||
|
||||
[Winbatch_extract]
|
||||
"$InstallExe$" /extract:"$LogDir$"
|
||||
|
||||
[Winbatch_install]
|
||||
msiexec /i "$RealInstallMsi$" /l* "$LogDir$\$ProductId$.install_log.txt" /qb ALLUSERS=1 REBOOT=ReallySuppress
|
||||
REG ADD HKLM\SOFTWARE\Mozilla\MaintenanceService /v Attempted /t REG_DWORD /d 1 /f
|
||||
"$InstallExe$" -ms
|
||||
"%ProgramFiles64Dir%\Mozilla Maintenance Service\uninstall.exe" /S
|
||||
|
||||
[Files_install]
|
||||
; copy the ini file to the InstallDir
|
||||
copy "$IniCfgFile$" "$InstallDir$"
|
||||
copy "%ScriptPath%\*.cfg" "$InstallDir$"
|
||||
copy "%ScriptPath%\local-settings.js" "$InstallDir$\defaults\pref"
|
||||
copy -s "%ScriptPath%\X86_64\Addons\bundles\*.*" "$InstallDir$\distribution\bundles"
|
||||
copy -s "%ScriptPath%\X86_64\Addons\extensions\*.*" "$InstallDir$\extensions"
|
||||
|
||||
; Example of recursively copying some files into the installation directory:
|
||||
;
|
||||
; copy -s "%ScriptPath%\files\*.*" "$InstallDir$"
|
||||
copy -s "%ScriptPath%\X86\Addons\bundles\*.*" "$InstallDir$\distribution\bundles"
|
||||
copy -s "%ScriptPath%\X86\Addons\extensions\*.*" "$InstallDir$\extensions"
|
||||
|
||||
[Registry_install]
|
||||
; Example of setting some values of an registry key:
|
||||
|
||||
@@ -6,7 +6,8 @@
|
||||
[Actions]
|
||||
requiredWinstVersion >= "4.11.2.6"
|
||||
|
||||
DefVar $MsiIdOld$
|
||||
DefVar $UninstallProgram$
|
||||
DefVar $UninstallProgramOld$
|
||||
DefVar $IniFile$
|
||||
DefVar $IniCfgFile$
|
||||
DefVar $LogDir$
|
||||
@@ -32,7 +33,7 @@ Set $LogDir$ = "%SystemDrive%\tmp"
|
||||
; ----------------------------------------------------------------
|
||||
; - Please edit the following values -
|
||||
; ----------------------------------------------------------------
|
||||
Set $InstallDir$ = "%ProgramFiles64Dir%\Waterfox"
|
||||
Set $InstallDir$ = "%ProgramFiles64Dir%\Mozilla Waterfox"
|
||||
; ----------------------------------------------------------------
|
||||
|
||||
Set $IniCfgFile$ = "%ScriptPath%\opsi-" + $ProductId$ + ".ini"
|
||||
|
||||
Reference in New Issue
Block a user