netfx35 war: Net Framework 2.0 SP2

Antworten
mhaegele
Beiträge: 293
Registriert: 18 Aug 2010, 13:55

netfx35 war: Net Framework 2.0 SP2

Beitrag von mhaegele »

Hallo!

Habe versucht ein Net Framework Paket zusammenzustellen, dabei wurde die Exe
NetFx20SP2_x86.exe
downgeloadet und das Teil mit /x entpackt, dann mit u. a. Kommandozeile versucht zu inst..

Auszug aus setup.ins:

Code: Alles auswählen

msiexec /i %ScriptPath%\NetFx20SP2\wcu\dotNetFramework\dotNetFX20\netfx20a_x86.msi /qb VSEXTUI=1
An einem Win7 Client hat die Installation geklappt, an einem WinXP Client bricht ist es mit Fehlermeldung ab:

Code: Alles auswählen

Bei der Installation des Paketes ist ein unerwarteter Fehler aufgetreten. Es liegt eventuell ein das Paket betreffendes Problem vor.
Der Fehlercode ist 2721.
Diese Box muß mit "OK" bestätigt werden ...

Möchte eigentlich nur das NET Framework 2.0 SP2 als Voraussetzung für weitere Pakete installieren,
im Wiki hab ich Anleitungen für NET Framework 4.5 etc. gefunden, das brauch ich allerdings nicht komplett ...
Jemand ne Idee oder ein funktionierendes Skript?
Danke Im Voraus!
Zuletzt geändert von mhaegele am 21 Feb 2013, 15:19, insgesamt 1-mal geändert.
thomas.besser
Beiträge: 472
Registriert: 09 Sep 2009, 09:40

Re: Net Framework 2.0 SP2

Beitrag von thomas.besser »

Hi,

schau dir mal das hier an: http://msdn.microsoft.com/en-us/library/bb822049.aspx

Danach haben wir für uns ein dotnetfx Paket gebaut, dass unter WinXP .NET 3.5 (und IMO .NET 2.0 sowie .NET 3.0 enthält) und .NET 4.0 (ohne localadmin!) installiert. Damit die Installation von 3.5 ohne Fehlermeldung läuft, installieren wir vorher 'RGB9RAST_x86.msi' (Paket entpacken, siehe http://blogs.msdn.com/b/astebner/archiv ... 95739.aspx) separat.

Win7: bis einschliesslich 3.5 ist das schon mit dabei, hier muß lediglich 4.0 nachinstalliert werden.

HTH
Thomas
mhaegele
Beiträge: 293
Registriert: 18 Aug 2010, 13:55

Re: Net Framework 2.0 SP2

Beitrag von mhaegele »

Danke für das schöne Schaubild. D. h. daß die früheren Versionen der NetFrameworks in den aktuelleren enthalten sind wenn ich das richtig verstanden habe ...
(Also in 4.0 ist z.B. 2.0, 3.5 enthalten ...)
Habe mal das setup.ins aus dem Wiki genommen:
wiki/userspace:netfx_4.0

Bricht mit folgendem Fehler ab:
Box: AutoIT Error

Code: Alles auswählen

Line 1 (File "c:\tmp\_winstbat_3.bat"):
$ExitCode = RunAsWait("opsiSetupAdmin", @ComputerName, "T[n26Z;x89",1, ""C:\tmp\dotnetfx40_full_x86_x64.exe" /passive /norestart')
$Exitcode = ^ERROR
Error: Unknown function name.
Den namen opsisetupadmin habe ich nicht angepasst, da er diesen ja als temporären Admin anlegen kann und danach wieder löscht
sollte also nicht relevant sein?

logauszug vom Client:

Code: Alles auswählen

[5] [18.02.2013 15:26:21]   Execution of FilesCopy
[7] [18.02.2013 15:26:21]     copy "P:\install\netfx40\dotNetFx40_Full_x86_x64.exe" "C:\tmp"
[6] [18.02.2013 15:26:21]     Copying  P:\install\netfx40\dotNetFx40_Full_x86_x64.exe -----> C:\tmp
[5] [18.02.2013 15:26:21]       1 File(s) found
[6] [18.02.2013 15:26:21]       Source P:\install\netfx40\dotNetFx40_Full_x86_x64.exe
[6] [18.02.2013 15:26:21]         Info: Target C:\tmp\dotNetFx40_Full_x86_x64.exe exists and shall be overwritten
[6] [18.02.2013 15:26:26]         P:\install\netfx40\dotNetFx40_Full_x86_x64.exe copied to C:\tmp\
[5] [18.02.2013 15:26:26]       1 File(s) treated
[5] [18.02.2013 15:26:26]   message Installing dotNetFX 32 Bit...
[5] [18.02.2013 15:26:26]   comment: Start setup program
[5] [18.02.2013 15:26:26] 
[5] [18.02.2013 15:26:26] Execution of DosBatchUserdel
[6] [18.02.2013 15:26:26]   C:\tmp\_winstbat_1.bat saved back
[6] [18.02.2013 15:26:26]   Executing "cmd.exe" /C "C:\tmp\_winstbat_1.bat"
[5] [18.02.2013 15:26:27] 
[5] [18.02.2013 15:26:27] Execution of DosBatchUseradd
[6] [18.02.2013 15:26:27]   C:\tmp\_winstbat_2.bat saved back
[6] [18.02.2013 15:26:27]   Executing "cmd.exe" /C "C:\tmp\_winstbat_2.bat"
[7] [18.02.2013 15:26:27]   
[7] [18.02.2013 15:26:27]   (created string list $res$)
[5] [18.02.2013 15:26:27]   
[5] [18.02.2013 15:26:27]   Set  $res$ = getOutStreamFromSection("ExecWithSetup 'P:\install\netfx40\AutoIt3.exe' WINST")
[5] [18.02.2013 15:26:27]     
[5] [18.02.2013 15:26:27]     Execution of ExecWithSetup
[6] [18.02.2013 15:26:27]       C:\tmp\_winstbat_3.bat saved back
[6] [18.02.2013 15:26:27]       Executing "P:\install\netfx40\AutoIt3.exe"  "C:\tmp\_winstbat_3.bat"  
[6] [18.02.2013 15:32:50]                   
[6] [18.02.2013 15:32:50]                   output:
[6] [18.02.2013 15:32:50]                   --------------
[6] [18.02.2013 15:32:50]       
[6] [18.02.2013 15:32:50]       retrieving strings from getOutStreamFromSection [switch to loglevel 7 for debugging]
[7] [18.02.2013 15:32:50]           
[5] [18.02.2013 15:32:50]   
[5] [18.02.2013 15:32:50]   If
[6] [18.02.2013 15:32:50]         retrieving strings from $res$ [switch to loglevel 7 for debugging]
[7] [18.02.2013 15:32:50]             
[5] [18.02.2013 15:32:50]     count($res$) = "1"   <<< result false
[5] [18.02.2013 15:32:50]   Then
[5] [18.02.2013 15:32:50]     
[5] [18.02.2013 15:32:50]     If
[5] [18.02.2013 15:32:50]     Then
[5] [18.02.2013 15:32:50]     EndIf
[5] [18.02.2013 15:32:50]   
[5] [18.02.2013 15:32:50]   Else
[3] [18.02.2013 15:32:50]     Error: Fatal: Setup did not return exit code!
[5] [18.02.2013 15:32:50]     Error level set to fatal
[5] [18.02.2013 15:32:50]     Process aborted
[1] [18.02.2013 15:32:50] ___________________
[1] [18.02.2013 15:32:50] script finished
[1] [18.02.2013 15:32:50] 1 error
[1] [18.02.2013 15:32:50] 1 warning
skript 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 $UninstallProgram32$
DefVar $UninstallProgram64$
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_Cmd32$
DefVar $Inst_Cmd64$
DefVar $Uninst_Cmd32$
DefVar $Uninst_Cmd64$
DefVar $Inst_Prg$
DefVar $Uninst_Prg$
DefVar $LogDir$
DefVar $opsiadminuser$
DefVar $opsiadminpwd$
 
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$       = "dotNetFX"
Set $Version$         = "4.0"
Set $MinimumSpace$    = "55 MB"
; the path were we find the product after the installation
Set $InstallDir32$    = "%Systemroot%\Microsoft.NET\Framework\v4.0.30319\SetupCache\Extended\"
Set $InstallDir64$    = "%Systemroot%\Microsoft.NET\Framework64\v4.0.30319\SetupCache\Extended\"
Set $LicenseRequired$ = "false"
Set $LicensePool$     = "p_" + $ProductId$
Set $Inst_Prg$        = "dotNetFx40_Full_x86_x64.exe"
Set $Inst_Cmd32$      = '/passive /norestart'
Set $Inst_Cmd64$      = 'NOT NEEDED HERE!'
Set $Uninst_Cmd32$    = '/uninstall /x86 /x64 /ia64 /parameterfolder Extended /passive /norestart'
Set $Uninst_Cmd64$    = '/uninstall /x86 /x64 /ia64 /parameterfolder Extended /passive /norestart'
Set $Uninst_Prg$        = "setup.exe"
Set $opsiadminuser$ = "opsiSetupAdmin"
Set $opsiadminpwd$ = randomstr
; ----------------------------------------------------------------
 
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$ + ".jpg" $ProductId$+" "+$Version$
 
        if FileExists("%ScriptPath%\delsub.ins")
                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 "installing"
 
        Message "Copying Setup to Disk..."
        FilesCopy
        Message "Installing " + $ProductId$ + " 32 Bit..."
        comment "Start setup program"
        DosBatchUserdel
        DosBatchUseradd
        DefStringList $res$
        Set $res$ = getOutStreamFromSection("ExecWithSetup '%ScriptPath%\AutoIt3.exe' WINST")
        if count($res$) = "1"
            DefVar $e$
            Set $e$ = takeString(0, $res$)
            Comment "setup exit code: " + $e$
            if ($e$ = "1614") or ($e$ = "3010")
                ExitWindows /Reboot
            endif
        else
            LogError "Fatal: Setup did not return exit code!"
            IsFatalError
        endif
        DosBatchUserdel
        ; Ok, let's check, if .Net Framework was installed...
        if not(FileExists("%systemroot%\Microsoft.NET\Framework\v4.0.30319"))
            LogError "Fatal: Framework not found!"
            IsFatalError
        endif
        FilesDelete
        Sub_check_exitcode
 
endif
 
[FilesCopy]
copy "%ScriptPath%\dotNetFx40_Full_x86_x64.exe" "$LogDir$"
 
[DosBatchUseradd]
net user "$opsiadminuser$" "$opsiadminpwd$" /add
net localgroup Administratoren /add "$opsiadminuser$"
 
[DosBatchUserdel]
net user "$opsiadminuser$" /delete
rmdir /s /q "%ProfileDir%\$opsiadminuser$"
 
[ExecWithSetup]
; http://msdn.microsoft.com/library/ee942965%28v=VS.100%29.aspx
; return exit code via stdout as winst cannot read exit codes from ExecWith
$ExitCode = RunAsWait("$opsiadminuser$", @ComputerName, "$opsiadminpwd$", 1, _
  '"$LogDir$\$Inst_Prg$" $Inst_Cmd32$')
if not @error then
  ConsoleWrite($exitcode)
endif
 
[FilesDelete]
delete "$LogDir$/$Inst_Prg$"
 
[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
thomas.besser
Beiträge: 472
Registriert: 09 Sep 2009, 09:40

Re: Net Framework 2.0 SP2

Beitrag von thomas.besser »

mhaegele hat geschrieben:D. h. daß die früheren Versionen der NetFrameworks in den aktuelleren enthalten sind wenn ich das richtig verstanden habe ...
(Also in 4.0 ist z.B. 2.0, 3.5 enthalten ...)
Nein, ganz so einfach isses nicht. Schaue auf die 'common language runtime' (CLR), dann sollte es klarer werden. Unter 'Version History' ist es eigentlich genau beschrieben.
mhaegele hat geschrieben: Habe mal das setup.ins aus dem Wiki genommen:
wiki/userspace:netfx_4.0

Bricht mit folgendem Fehler ab:
Box: AutoIT Error
Ich verstehe ehrlich gesagt nicht, weshalb für .NET 4 'AutoIT' zur Installation genommen wird! In meinen Augen absolut unnötig. Wir installieren das einfach so:

Code: Alles auswählen

[Winbatch_install_40]
"%ScriptPath%\dotNetFx40_Full_x86_x64.exe" /q /norestart
Aber du wolltest doch eigentlich 2.0 installieren. IMO installierst du 3.5 unter WinXP (ist in Win7 schon vorhanden!), dann verwende den oben genannten Trick. Wir machen das mit:

Code: Alles auswählen

[Winbatch_install_35]
msiexec /i RGB9RAST_x86.msi /qn ALLUSERS=1 REBOOT=ReallySuppress
"%ScriptPath%\dotnetfx35.exe" /q /norestart
Gruß
Thomas
Benutzeravatar
SisterOfMercy
Beiträge: 1556
Registriert: 22 Jun 2012, 19:18

Re: Net Framework 2.0 SP2

Beitrag von SisterOfMercy »

I recently found a way of telling a program to use a newer version of the .net lamework.
If the executable is runme.exe, you create a text file with the name runme.exe.config, with these contents:

Code: Alles auswählen

<configuration>
   <startup>
      <supportedRuntime version="v4.5.50709"/>
      <supportedRuntime version="v4.0.30319"/>
      <supportedRuntime version="v3.5.21022"/>
      <supportedRuntime version="v3.0.4506"/>
      <supportedRuntime version="v2.0.50727"/>      
      <supportedRuntime version="v1.1.4322"/>
      <supportedRuntime version="v1.0.3705"/>
   </startup>
</configuration>
This does not work for every application, because some are depending on certain features in older lamework versions. But for mostly simple applications this works fine, so you do not need to install every !%#!%##$- :evil:- version. This is not really helping you out with installing the 2.0 version, but if you only need it for a few applications you could test if the .config-file is a good enough workaround.
Bitte schreiben Sie Deutsch, when I'm responding in the German-speaking part of the forum!
mhaegele
Beiträge: 293
Registriert: 18 Aug 2010, 13:55

Re: Net Framework 2.0 SP2

Beitrag von mhaegele »

thomas.besser hat geschrieben: Aber du wolltest doch eigentlich 2.0 installieren. IMO installierst du 3.5 unter WinXP (ist in Win7 schon vorhanden!), dann verwende den oben genannten Trick. Wir machen das mit:

Code: Alles auswählen

[Winbatch_install_35]
msiexec /i RGB9RAST_x86.msi /qn ALLUSERS=1 REBOOT=ReallySuppress
"%ScriptPath%\dotnetfx35.exe" /q /norestart
Gruß
Thomas
Danke habe das mit dem netfx35 aus dem Wiki kombiniert, leider gibt es an manchen Clients eine Fehlermeldungsbox:
"Aktion nur gültig für installiertes ..." welche man bestätigen müssten im Log steht dazu:

Jemand ne Idee
Lamework trifft das echt gut ...
  • [5] [21.02.2013 14:01:39] GetRegistryStringValue32("[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\" + $MsiId32_1$ + "] DisplayName") = "" <<< result false
    [5] [21.02.2013 14:01:39] not (GetRegistryStringValue32("[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\" + $MsiId32_1$ + "] DisplayName") = "") <<< result true
    [5] [21.02.2013 14:01:39] Then
    [5] [21.02.2013 14:01:39] comment: MSI id {2FC099BD-AC9B-33EB-809C-D332E1B27C40} found in registry, starting msiexec to uninstall
    [5] [21.02.2013 14:01:39]
    [5] [21.02.2013 14:01:39] Execution of Winbatch_uninstall_msi_32
    [6] [21.02.2013 14:01:39] Call "msiexec /x {2FC099BD-AC9B-33EB-809C-D332E1B27C40} /qb! REBOOT=ReallySuppress"
    [6] [21.02.2013 14:01:39] Waiting until the called process is finished
    [6] [21.02.2013 14:02:20] ExitCode 0 Executed process "msiexec /x {2FC099BD-AC9B-33EB-809C-D332E1B27C40} /qb! REBOOT=ReallySuppress"
    [6] [21.02.2013 14:02:20] Call "msiexec /x {2BA00471-0328-3743-93BD-FA813353A783} /qb! REBOOT=ReallySuppress"
    [6] [21.02.2013 14:02:20] Waiting until the called process is finished
    [6] [21.02.2013 14:03:24] ExitCode 0 Executed process "msiexec /x {2BA00471-0328-3743-93BD-FA813353A783} /qb! REBOOT=ReallySuppress"
    [6] [21.02.2013 14:03:24] Call "msiexec /x {9309DD7E-EBFE-3C95-8B47-30D3A012F606} /qb! REBOOT=ReallySuppress"
    [6] [21.02.2013 14:03:24] Waiting until the called process is finished
    [6] [21.02.2013 14:04:38] ExitCode 1605 Executed process "msiexec /x {9309DD7E-EBFE-3C95-8B47-30D3A012F606} /qb! REBOOT=ReallySuppress"
    [6] [21.02.2013 14:04:38] Call "msiexec /x {A1071AEB-B0EF-3F5F-BC84-83A270EBE496} /qb! REBOOT=ReallySuppress"
    [6] [21.02.2013 14:04:38] Waiting until the called process is finished
    [6] [21.02.2013 14:04:38] ExitCode 1605 Executed process "msiexec /x {A1071AEB-B0EF-3F5F-BC84-83A270EBE496} /qb! REBOOT=ReallySuppress"
    [6] [21.02.2013 14:04:38] Call "msiexec /x {B508B3F1-A24A-32C0-B310-85786919EF28} /qb! REBOOT=ReallySuppress"
    [6] [21.02.2013 14:04:38] Waiting until the called process is finished
    [6] [21.02.2013 14:06:22] ExitCode 0 Executed process "msiexec /x {B508B3F1-A24A-32C0-B310-85786919EF28} /qb! REBOOT=ReallySuppress"
    [6] [21.02.2013 14:06:22] Call "msiexec /x {1545207E-C6F3-31D7-9918-BDBB65075FBF} /qb! REBOOT=ReallySuppress"
    [6] [21.02.2013 14:06:22] Waiting until the called process is finished
    [6] [21.02.2013 14:08:24] ExitCode 1605 Executed process "msiexec /x {1545207E-C6F3-31D7-9918-BDBB65075FBF} /qb! REBOOT=ReallySuppress"
    [6] [21.02.2013 14:08:24]
    [6] [21.02.2013 14:08:24] ~~~~~~~ Start Sub ~~~~~~~ sub_check_exitcode
    [5] [21.02.2013 14:08:24] comment: Test for installation success via exit code
    [5] [21.02.2013 14:08:24]
    [5] [21.02.2013 14:08:24] Set $ExitCode$ = getLastExitCode
    [6] [21.02.2013 14:08:24] The value of the variable "$ExitCode$" is now: "1605"
    [5] [21.02.2013 14:08:24]
    [5] [21.02.2013 14:08:24] If
    [5] [21.02.2013 14:08:24] $ExitCode$ = "0" <<< result false
    [5] [21.02.2013 14:08:24] ($ExitCode$ = "0") <<< result false
    [5] [21.02.2013 14:08:24] Then
    [5] [21.02.2013 14:08:24]
    [5] [21.02.2013 14:08:24] Else
    [5] [21.02.2013 14:08:24] comment: Setup program gives a exitcode unequal zero: 1605
    [5] [21.02.2013 14:08:24]
    [5] [21.02.2013 14:08:24] If
    [5] [21.02.2013 14:08:24] $ExitCode$ = "1605" <<< result true
    [5] [21.02.2013 14:08:24] ($ExitCode$ = "1605") <<< result true
    [5] [21.02.2013 14:08:24] Then
    [5] [21.02.2013 14:08:24] comment: ERROR_UNKNOWN_PRODUCT 1605 This action is only valid for products that are currently installed.
    [5] [21.02.2013 14:08:24] comment: Uninstall of a not installed product failed - no problem
Antworten