User Tools

Site Tools


userspace:netfx_4.0

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
userspace:netfx_4.0 [2011/11/03 10:25]
Thomas_H
userspace:netfx_4.0 [2021/08/23 08:37] (current)
Line 1: Line 1:
 ====== .NetFX 4.0 ====== ====== .NetFX 4.0 ======
 +
 +**Versions**\\
 +By  //[[hungerharke@gmx.de|Thomas_H]] 2011/11/09 08:56// \\
 +By  //[[hungerharke@gmx.de|Thomas_H]] 2011/11/16 13:25// Thanks to Karsten K. for informations about incompleted deinstallation.
 +
  
 Tested with opsi 4.0.1\\ Tested with opsi 4.0.1\\
 requiredWinstVersion >= 4.10.8.6 requiredWinstVersion >= 4.10.8.6
-By //[[hungerharke@gmx.de|Thomas_H]] 2011/10/27 16:08// \\+By  //[[hungerharke@gmx.de|Thomas_H]] 2011/11/09 08:56// \\
 The installation-files can be downloaded at http://www.microsoft.com/downloads/de-de/details.aspx?FamilyID=0a391abd-25c1-4fc0-919f-b21f31ab88b7 The installation-files can be downloaded at http://www.microsoft.com/downloads/de-de/details.aspx?FamilyID=0a391abd-25c1-4fc0-919f-b21f31ab88b7
 +
 +Special thanks to: joerg.ludwig for his code, to be found in the [[https://forum.opsi.org/viewtopic.php?f=7&t=957&start=30|Forum]] which solved the problem of a failed installation when re-installing the OS on a PC.
  
 Tree:\\ Tree:\\
 +AutoIt3.exe\\
 delsub.ins\\ delsub.ins\\
 dotNetFX.jpg\\ dotNetFX.jpg\\
Line 15: Line 23:
 ==== setup.ins ==== ==== setup.ins ====
 <code winst> <code winst>
- 
 [Initial] [Initial]
 LogLevel=9 LogLevel=9
Line 51: Line 58:
 DefVar $Uninst_Prg$ DefVar $Uninst_Prg$
 DefVar $LogDir$ DefVar $LogDir$
 +DefVar $opsiadminuser$
 +DefVar $opsiadminpwd$
  
 Set $INST_SystemType$ = GetSystemType Set $INST_SystemType$ = GetSystemType
Line 57: Line 66:
  
 Set $LogDir$ = "%SystemDrive%\tmp" Set $LogDir$ = "%SystemDrive%\tmp"
 +
 ; ---------------------------------------------------------------- ; ----------------------------------------------------------------
 ; - Please edit the following values                             - ; - Please edit the following values                             -
Line 72: Line 82:
 Set $LicensePool$     = "p_" + $ProductId$ Set $LicensePool$     = "p_" + $ProductId$
 Set $Inst_Prg$        = "dotNetFx40_Full_x86_x64.exe" Set $Inst_Prg$        = "dotNetFx40_Full_x86_x64.exe"
-Set $Inst_Cmd32$      = '/passive /norestart /showfinalerror /LCID 1031+Set $Inst_Cmd32$      = '/passive /norestart' 
-Set $Inst_Cmd64$      = '/passive /norestart /showfinalerror /LCID 1031'+Set $Inst_Cmd64$      = 'NOT NEEDED HERE!'
 Set $Uninst_Cmd32$    = '/uninstall /x86 /x64 /ia64 /parameterfolder Extended /passive /norestart' Set $Uninst_Cmd32$    = '/uninstall /x86 /x64 /ia64 /parameterfolder Extended /passive /norestart'
 Set $Uninst_Cmd64$    = '/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 $Uninst_Prg$        = "setup.exe"
 +Set $opsiadminuser$ = "opsiSetupAdmin"
 +Set $opsiadminpwd$ = randomstr
 ; ---------------------------------------------------------------- ; ----------------------------------------------------------------
  
Line 85: Line 97:
 else else
         comment "Show product picture"         comment "Show product picture"
-        ShowBitmap "%ScriptPath%\" + $ProductId$ + ".jpg" $ProductId$+        ShowBitmap "%ScriptPath%\" + $ProductId$ + ".jpg" $ProductId$+" "+$Version$
  
         if FileExists("%ScriptPath%\delsub.ins")         if FileExists("%ScriptPath%\delsub.ins")
Line 99: Line 111:
         comment "installing"         comment "installing"
  
-        if (($INST_SystemType$ = "x86 System"and ($INST_architecture$ = "system specific")) or ($INST_architecture$ = "both") or ($INST_architecture$ = "32 only") +        Message "Copying Setup to Disk..." 
-                Message "Installing " + $ProductId$ + " 32 Bit..." +        FilesCopy 
-                comment "Start setup program+        Message "Installing " + $ProductId$ + " 32 Bit..." 
-                Winbatch_install_32 +        comment "Start setup program" 
-                Sub_check_exitcode+        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         endif
- +        DosBatchUserdel 
-        if ($INST_SystemType$ = "64 Bit System") and (($INST_architecture$ = "system specific") or ($INST_architecture$ = "both") or ($INST_architecture$ = "64 only")) +        ; Ok, let's check, if .Net Framework was installed... 
-                Message "Installing " + $ProductId$ + " 64 Bit..." +        if not(FileExists("%systemroot%\Microsoft.NET\Framework\v4.0.30319")) 
-                comment "Start setup program+            LogError "Fatal: Framework not found!
-                Winbatch_install_64 +            IsFatalError
-                Sub_check_exitcode+
         endif         endif
 +        FilesDelete
 +        Sub_check_exitcode
  
 endif endif
  
-[Winbatch_install_32+[FilesCopy
-"%ScriptPath%\$Inst_Prg$" $Inst_Cmd32$+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
  
-[Winbatch_install_64+[FilesDelete
-"%ScriptPath%\$Inst_Prg$$Inst_Cmd64$+delete "$LogDir$/$Inst_Prg$"
  
 [Sub_check_exitcode] [Sub_check_exitcode]
Line 151: Line 193:
 endif endif
  
-</code> 
  
 +</code>
 ==== uninstall.ins ==== ==== uninstall.ins ====
  
Line 172: Line 214:
 DefVar $UninstallProgram32$ DefVar $UninstallProgram32$
 DefVar $UninstallProgram64$ DefVar $UninstallProgram64$
 +DefVar $UninstallProgram32_2$
 +DefVar $UninstallProgram64_2$
 DefVar $LogDir$ DefVar $LogDir$
 DefVar $ExitCode$ DefVar $ExitCode$
 DefVar $ProductId$ DefVar $ProductId$
 DefVar $InstallDir32$ DefVar $InstallDir32$
 +DefVar $InstallDir32_2$
 DefVar $InstallDir64$ DefVar $InstallDir64$
 +DefVar $InstallDir64_2$
 DefVar $LicenseRequired$ DefVar $LicenseRequired$
 DefVar $LicensePool$ DefVar $LicensePool$
Line 182: Line 228:
 DefVar $INST_architecture$ DefVar $INST_architecture$
 DefVar $Uninst_Cmd32$ DefVar $Uninst_Cmd32$
 +DefVar $Uninst_Cmd32_2$
 DefVar $Uninst_Cmd64$ DefVar $Uninst_Cmd64$
 +DefVar $Uninst_Cmd64_2$
 DefVar $Uninst_Prg$ DefVar $Uninst_Prg$
  
Line 196: Line 244:
 Set $ProductId$       = "dotNETFx" Set $ProductId$       = "dotNETFx"
 Set $InstallDir32$    = "%Systemroot%\Microsoft.NET\Framework\v4.0.30319\SetupCache\Extended\" Set $InstallDir32$    = "%Systemroot%\Microsoft.NET\Framework\v4.0.30319\SetupCache\Extended\"
 +Set $InstallDir32_2$  = "%Systemroot%\Microsoft.NET\Framework\v4.0.30319\SetupCache\Client\"
 Set $InstallDir64$    = "%Systemroot%\Microsoft.NET\Framework64\v4.0.30319\SetupCache\Extended\" Set $InstallDir64$    = "%Systemroot%\Microsoft.NET\Framework64\v4.0.30319\SetupCache\Extended\"
 +Set $InstallDir64_2$  = "%Systemroot%\Microsoft.NET\Framework\v4.0.30319\SetupCache\Client\"
 Set $LicenseRequired$ = "false" Set $LicenseRequired$ = "false"
 Set $LicensePool$     = "p_" + $ProductId$ Set $LicensePool$     = "p_" + $ProductId$
 Set $Uninst_Prg$        = "setup.exe" Set $Uninst_Prg$        = "setup.exe"
 Set $Uninst_Cmd32$        = '/uninstall /x86 /x64 /ia64 /parameterfolder Extended /passive /norestart' Set $Uninst_Cmd32$        = '/uninstall /x86 /x64 /ia64 /parameterfolder Extended /passive /norestart'
 +Set $Uninst_Cmd32_2$      = '/uninstall /x86 /x64 /parameterfolder Client /passive /norestart'
 Set $Uninst_Cmd64$        = '/uninstall /x86 /x64 /ia64 /parameterfolder Extended /passive /norestart' Set $Uninst_Cmd64$        = '/uninstall /x86 /x64 /ia64 /parameterfolder Extended /passive /norestart'
 +Set $Uninst_Cmd64_2$      = '/uninstall /x86 /x64 /parameterfolder Client /passive /norestart'
 ; ---------------------------------------------------------------- ; ----------------------------------------------------------------
  
Line 244: Line 296:
 Set $UninstallProgram32$ = $InstallDir32$+"\"+$Uninst_Prg$ Set $UninstallProgram32$ = $InstallDir32$+"\"+$Uninst_Prg$
 Set $UninstallProgram64$ = $InstallDir64$+"\"+$Uninst_Prg$ Set $UninstallProgram64$ = $InstallDir64$+"\"+$Uninst_Prg$
 +
 +Set $UninstallProgram32_2$ = $InstallDir32_2$+"\"+$Uninst_Prg$
 +Set $UninstallProgram64_2$ = $InstallDir64_2$+"\"+$Uninst_Prg$
  
 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")
Line 255: Line 310:
                 sub_check_exitcode                 sub_check_exitcode
         endif         endif
-Mendif+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"))
Line 271: Line 326:
 [Winbatch_uninstall_32] [Winbatch_uninstall_32]
 $UninstallProgram32$ $Uninst_Cmd32$ $UninstallProgram32$ $Uninst_Cmd32$
 +$UninstallProgram32_2$ $Uninst_Cmd32_2$
  
 [Winbatch_uninstall_64] [Winbatch_uninstall_64]
 $UninstallProgram64$ $Uninst_Cmd64$ $UninstallProgram64$ $Uninst_Cmd64$
 +$UninstallProgram64_2$ $Uninst_Cmd64_2$
  
 [Files_uninstall_32] [Files_uninstall_32]
userspace/netfx_4.0.1320315953.txt.gz · Last modified: 2021/08/23 08:37 (external edit)