PDFCreator 1.7 durch 2.1.1 ersetzen

Antworten
Benutzeravatar
D1Ck3n
Beiträge: 191
Registriert: 15 Mär 2013, 11:05

PDFCreator 1.7 durch 2.1.1 ersetzen

Beitrag von D1Ck3n »

Hallo zusammen,

ich habe für die PDFCreator Installation das Skript aus dem UiB-Wiki (wiki/userspace:pdf-creator) genommen und angepasst, damit ich damit die neueste Version vom PDFCreator installieren kann. Wenn auf dem Client noch keine Version des Programms installiert ist, läuft die Installation auch einwandfrei durch, aber wenn schon eine Vorgänger-Version installiert ist, bekomme ich folgende Meldung:

Bild

Und hier meine Skripte:

setup.ins

Code: Alles auswählen

[Initial]
LogLevel=9
;  Log Errors in Logfile but don't abort:
ExitOnError=false
; Show syntax errors in the script:
ScriptErrorMessages=on
; Dont trace step by step through the script:
TraceMode=off
; let started programs run in front of the winst window
StayOnTop=false
 
 
[Actions]
requiredWinstVersion >= "4.10.8.6"
 
DefVar $MsiId32$
DefVar $MsiId64$
DefVar $LogDir$
DefVar $ProductId$
DefVar $MinimumSpace$
DefVar $InstallDir32$
DefVar $InstallDir64$
DefVar $ExitCode$
DefVar $LicenseRequired$
DefVar $LicenseKey$
DefVar $LicensePool$
DefVar $INST_SystemType$
DefVar $INST_architecture$
DefVar $Version$
DefVar $Inst_Cmd$
DefVar $Inst_Prg32$
DefVar $Inst_Prg64$
DefVar $Uninst_Cmd$
DefVar $Uninst_Prg$
 
Set $INST_SystemType$ = GetSystemType
set $INST_architecture$ = GetProductProperty("install_architecture","system specific")
 
 
Set $LogDir$ = "%SystemDrive%\tmp"
 
; ----------------------------------------------------------------
; - 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 $ProductId$       = "pdfcreator_2.1.1"
Set $Version$         = "2.1.1"
Set $MinimumSpace$    = "10 MB"
; the path were we find the product after the installation
Set $InstallDir32$      = "%ProgramFiles32Dir%\PDFCreator\"
Set $LicenseRequired$ = "false"
Set $LicensePool$     = "p_" + $ProductId$
Set $Inst_Prg32$      = "PDFCreator-2_1_1-setup.exe"
Set $Inst_Cmd$        = '/SILENT /NOCANCEL /NOICONS /LANG=De /NORESTART /LOADINF=%ScriptPath%\pdfcreator.ini'
Set $Uninst_Cmd$      = '/SILENT /NOCANCEL'
Set $Uninst_Prg$      = "unins000.exe"
; ----------------------------------------------------------------
 
comment "Show product picture"
ShowBitmap "%ScriptPath%\" + $ProductId$ + ".jpg" $ProductId$
 
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
 
        if FileExists("$InstallDir32$\$Uninst_Prg$")
                comment "Start uninstall sub section"
                Sub "%ScriptPath%\delsub.ins"
        endif
 
        if $LicenseRequired$ = "true"
                comment "Licensing required, reserve license and get license key"
                Sub_get_licensekey
        endif
 
        comment "Installiere "+$ProductID$+"..."
 
        if (($INST_SystemType$ = "x86 System") and ($INST_architecture$ = "system specific")) or ($INST_architecture$ = "both") or ($INST_architecture$ = "32 only")
                Message "Installiere " + $ProductId$+" (32 Bit)"
                comment "Start setup program"
                Winbatch_install_32
                Sub_check_exitcode
        endif
 
        if ($INST_SystemType$ = "64 Bit System") and (($INST_architecture$ = "system specific") or ($INST_architecture$ = "both") or ($INST_architecture$ = "64 only"))
                Message "Installiere " + $ProductId$+" (64 Bit)"
                comment "Start setup program"
; KEIN Fehler: Das Programm gibt es nur als 32 Bit-Variante, darum nachfolgend:
                Winbatch_install_32
                Sub_check_exitcode
        endif
 
endif
 
[Winbatch_install_32]
"%ScriptPath%\$Inst_Prg32$" $Inst_Cmd$
 
[Sub_check_exitcode]
comment "Test for installation success via exit code"
set $ExitCode$ = getLastExitCode
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
uninstall.ins

Code: Alles auswählen

[Initial]
LogLevel=9
;  Log Errors in Logfile but don't abort:
ExitOnError=false
; Show syntax errors in the script:
ScriptErrorMessages=on
; Dont trace step by step through the script:
TraceMode=off
; let started programs run in front of the winst window
StayOnTop=false
 
[Actions]
requiredWinstVersion >= "4.10.8.6"
 
DefVar $MsiId32$
DefVar $UninstallProgram32$
DefVar $MsiId64$
DefVar $LogDir$
DefVar $ExitCode$
DefVar $ProductId$
DefVar $InstallDir32$
DefVar $InstallDir64$
DefVar $LicenseRequired$
DefVar $LicensePool$
DefVar $INST_SystemType$
DefVar $INST_architecture$
DefVar $Uninst_Prg$
DefVar $Uninst_Cmd$
 
Set $INST_SystemType$ = GetSystemType
set $INST_architecture$ = GetProductProperty("install_architecture","system specific")
 
 
Set $LogDir$ = "%SystemDrive%\tmp"
 
; ----------------------------------------------------------------
; - Please edit the following values                             -
; ----------------------------------------------------------------
Set $ProductId$         = "pdfcreator_2.1.1"
Set $InstallDir32$      = "%ProgramFiles32Dir%\PDFCreator"
Set $LicenseRequired$   = "false"
Set $LicensePool$       = "p_" + $ProductId$
Set $Uninst_Cmd$        = '/SILENT /NOCANCEL'
Set $Uninst_Prg$        = "unins000.exe"
; ----------------------------------------------------------------
 
comment "Show product picture"
ShowBitmap "%ScriptPath%\" + $ProductId$ + ".jpg" $ProductId$
 
Message "Deinstalliere " + $ProductId$ + ". Bitte etwas Geduld..."
comment "Start uninstall sub section"
Sub "%ScriptPath%\delsub.ins"
 
if $LicenseRequired$ = "true"
        comment "Licensing required, free license used"
        Sub_free_license
endif
delsub.ins

Code: Alles auswählen

if (($INST_SystemType$ = "x86 System") and ($INST_architecture$ = "system specific")) or ($INST_architecture$ = "both") or ($INST_architecture$ = "32 only")
        Message "Uninstalling " + $ProductId$ + " 32 Bit..."
        Winbatch_uninstall_32
        comment "Removing "+$InstallDir32$
        Files_uninstall_32
        sub_check_exitcode
endif
 
if ($INST_SystemType$ = "64 Bit System") and (($INST_architecture$ = "system specific") or ($INST_architecture$ = "both") or ($INST_architecture$ = "64 only"))
        Message "Uninstalling " + $ProductId$ + " 32 Bit..."
; Kein Fehler: Das Programm gibt es nur in 32 Bit, darum nachfolgend:
        Winbatch_uninstall_32
        comment "Removing "+$InstallDir32$
        Files_uninstall_32
        sub_check_exitcode
endif
 
 
[Winbatch_uninstall_32]
"$InstallDir32$\$Uninst_Prg$" $Uninst_Cmd$
 
[Files_uninstall_32]
delete -sf "$InstallDir32$\"
 
[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
Gibt es eine möglichkeit, dass die Version 2.1.1 die alte Version einfach ersetzt, ohne das die Meldung kommt?

Gruß
D1Ck3n
Gruß
D1Ck3n
Benutzeravatar
SisterOfMercy
Beiträge: 1556
Registriert: 22 Jun 2012, 19:18

Re: PDFCreator 1.7 durch 2.1.1 ersetzen

Beitrag von SisterOfMercy »

Yes, first uninstall the previous version. I guess your delsub.ins does not run, or does not uninstall the previous version correctly.
Bitte schreiben Sie Deutsch, when I'm responding in the German-speaking part of the forum!
Antworten