how can first uninstall 32-bit version of firefox and then install 64- version of it?
Verfasst: 27 Nov 2017, 18:11
Hi,
I have 32-bit version of forefox in my computer. I want to first uninstall 32- version of firefox and then install 64- bit version of it, but I do not know how can I do this, anybody can help me?
these are my scripts:
firefox.ins:
delfirefox.ins:
delsub.ins:
common.opsiinc:
I have 32-bit version of forefox in my computer. I want to first uninstall 32- version of firefox and then install 64- bit version of it, but I do not know how can I do this, anybody can help me?
these are my scripts:
firefox.ins:
Code: Alles auswählen
[Aktionen]
; common Values for (un)installation
include_insert "common.opsiinc"
ChangeDirectory "%SCRIPTPATH%"
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 /3 "%scriptpath%\"+"firefox-logo.png" $ProductId$
if FileExists("%ScriptPath%\delsub.ins")
comment "start uninstall sub section"
sub "%ScriptPath%\delsub.ins"
endif
Message "Installing "+$ProductId$+" ..."
comment "start setup program"
Winbatch_install
sub_check_exitcode
comment "copy files"
Files_install
comment "test for installation success"
if not(FileExists($NewExe$))
logError "Fatal: After Installation "+$NewExe$+" not found"
isFatalError
endif
endif
[Winbatch_install]
; something like
"%SCRIPTPATH%\firefox.exe" -ms -ira
[Files_install]
; something like
; copy -sv "%SCRIPTPATH%\files\*.*" "%ProgramFiles64Dir%\$ProductId$"
; copy -s "%scriptpath%\extensions\*" "$InstallDir$\extensions\."
[Registry_set_language]
openkey [HKEY_CURRENT_USER\Software\Mozilla Firefox]
set "Lang" = REG_SZ:"$language$"
Code: Alles auswählen
[Actions]
; common Values for (un)installation
include_insert "common.opsiinc"
comment "show product picture"
ShowBitmap /3 "%scriptpath%\"+$ProductId$+".bmp" $ProductId$
if FileExists("%ScriptPath%\delsub.ins")
comment "start uninstall sub section"
sub "%ScriptPath%\delsub.ins"
endif
Code: Alles auswählen
Set $UninstallProgram$ = $InstallDir$ + "\uninstall\helper.exe"
Message "Uninstalling (old) " + $ProductId$ + " ..."
if FileExists($UninstallProgram$)
comment "Uninstall program found, starting uninstall"
Winbatch_uninstall /WaitforProcessending "helper.exe" /Timeoutseconds 10
sub_check_exitcode
endif
endif
if (not($InstallDir$ = '')) and (not($InstallDir$ = "not used"))
Files_uninstall
endif
;-----------------------------------------------------
[Winbatch_uninstall]
"$UninstallProgram$" /S
[Files_uninstall]
del -sf "$InstallDir$\"
[Sub_check_exitcode]
Sub "%ScriptPath%\check_nsis-exitcode.opsiscript"
Code: Alles auswählen
DefVar $TEMP$
DefVar $ProductId$
DefVar $ExeName$
DefVar $MinimumSpace$
DefVar $NewExe$
DefVar $InstallDir$
DefVar $ExitCode$
DefVar $UninstallProgram$
Set $TEMP$ = EnvVar("TEMP")
; ----------------------------------------------------------------
; - Please edit the following values -
; ----------------------------------------------------------------
set $ProductId$ = "Mozilla Firefox"
set $ExeName$ = "firefox"
set $MinimumSpace$ = "100 MB"
set $InstallDir$="%ProgramFiles64Dir%\"+$ProductId$
set $NewExe$=$InstallDir$+"\"+$ExeName$+".exe"
; ----------------------------------------------------------------
[sub_check_exitcode]
comment "test for installation success via exit code"
set $ExitCode$ = getLastExitCode
; informations to exit codes see
; http://msdn.microsoft.com/en-us/library/aa372835(VS.85).aspx
; http://msdn.microsoft.com/en-us/library/aa368542.aspx
if ($ExitCode$ = "0")
comment "looks good: setup program gives exitcode zero"
else
comment "Setup program gives a exitcode unequal zero: "+$ExitCode$
if ($ExitCode$ = "1605")
comment "ERROR_UNKNOWN_PRODUCT 1605 This action is only valid for products that are currently installed."
comment "Uninstall of a not installed product failed - no problem"
else
if ($ExitCode$ = "1641")
comment "looks good: setup program gives exitcode 1641"
comment "ERROR_SUCCESS_REBOOT_INITIATED 1641 The installer has initiated a restart. This message is indicative of a success."
else
if ($ExitCode$ = "3010")
comment "looks good: setup program gives exitcode 3010"
comment "ERROR_SUCCESS_REBOOT_REQUIRED 3010 A restart is required to complete the install. This message is indicative of a success."
else
logError "Fatal: Setup program gives an unknown exitcode unequal zero: "+$ExitCode$
isFatalError
endif
endif
endif
endif
Set $language$ = GetProductProperty("language", "auto")
if ($language$ = "auto")
set $languagemap$ = GetLocaleInfoMap
set $system_language$ = lower(getValue("system_default_language_id", $languagemap$))
Switch $system_language$
Case "0407"
set $language$ = "de"
EndCase
Case "0409"
set $language$ = "en"
EndCase
DefaultCase
set $language$ = "de"
EndCase
EndSwitch
endif