Updated version

Removed special XP bugfix and net framework packs
Added windows 8 support and net framework installation (manually, by copy files from installation medium to opsi server)
This commit is contained in:
Peter Singer
2013-01-03 15:19:16 +01:00
parent 22c983b711
commit 19e0f40002
8 changed files with 131 additions and 149 deletions

View File

@@ -29,8 +29,10 @@ Set $LogDir$ = "%SystemDrive%\tmp"
DefVar $MSVersion$
Set $MSVersion$ = GetMsVersionInfo
DefVar $xp_wsus_bugfix$
Set $xp_wsus_bugfix$ = GetProductProperty("xp_wsus_bugfix", "1")
DefVar $win8_net3.5$
Set $win8_net3.5$ = GetProductProperty("win8_net3.5", "1")
DefVar $java_reinstall$
Set $java_reinstall$ = GetProductProperty("java_reinstall", "1")
@@ -127,81 +129,15 @@ else
if (($INST_SystemType$ = "x86 System") and ($INST_architecture$ = "system specific")) or ($INST_architecture$ = "both") or ($INST_architecture$ = "32 only")
Message "Installing " + $ProductId$ + " 32 Bit..."
if (( $MSVersion$ = "5.1" ) and ($xp_wsus_bugfix$ = "1"))
if (GetRegistryStringValue32("[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{C09FB3CD-3D0C-3F2D-899A-6A1D67F2073F}] DisplayName") = "")
comment "DotNet 2.0 SP2 not found in registry, starting install dotNetFX3.5"
Message "Installing " + "dotNetFX 2 - 3.5" + " 32 Bit..."
Winbatch_install_dotNet_XP_2-3.5_32
sub_check_exitcode
endif
if (GetRegistryStringValue32("[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{3C3901C5-3455-3E0A-A214-0B093A5070A6}] DisplayName") = "")
comment "DotNet 4.0 not found in registry, starting install dotNetFX4 install"
Message "Installing " + "dotNetFX 4" + " 32 Bit..."
Winbatch_install_dotNet_XP_4_32
sub_check_exitcode
endif
endif
comment "Reinstall Java"
if ($java_reinstall$ = "1")
Message "Uninstalling " + "Java" + " 32 Bit..."
Dosbatch_java_reinstall
endif
comment "Install the extracted version of the sereby packet on opsiserver"
if (($extract_install$ = "1") and not (FileExists("%ScriptPath%\X86\sereby\extracted\WinPKG.exe")))
Message "Installing " + $ProductId$ + " on depotserver..."
Dosbatch_extract_install
endif
comment "Get connection latency between server and client"
if ($extract_use$ = "auto")
Message "Get connection latency..."
Dosbatch_get_connection_latency
Set $Output$ = getOutStreamFromSection('Dosbatch_get_connection_latency')
Set $connection_wan$ = takeFirstStringContaining($Output$, "opsi wan mode : ")
Set $connection_wan$ = TakeString(1, SplitString($connection_wan$, " : "))
endif
comment "Build sereby configuration"
Message "Build sereby configuration"
Dosbatch_build_config
comment "Choose version to install"
if (($extract_use$ = "1") or (($extract_use$ = "auto") and ($connection_wan$ = "1")))
Message "Installing extracted " + $ProductId$ + " 32 Bit..."
comment "Start extracted setup program"
Dosbatch_install_extracted_32
Sub_check_exitcode
else
Message "Installing " + $ProductId$ + " 32 Bit..."
comment "Start setup program"
Winbatch_install_32
Sub_check_exitcode
endif
comment "Copy files"
Files_install_32 /32Bit
comment "Patch Registry"
Registry_install /32Bit
comment "Create shortcuts"
LinkFolder_install
endif
if ($INST_SystemType$ = "64 Bit System") and (($INST_architecture$ = "system specific") or ($INST_architecture$ = "both") or ($INST_architecture$ = "64 only"))
Message "Installing " + $ProductId$ + " 64 Bit..."
if (( $MSVersion$ = "5.1" ) and ($xp_wsus_bugfix$ = "1"))
if (GetRegistryStringValue64("[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{C09FB3CD-3D0C-3F2D-899A-6A1D67F2073F}] DisplayName") = "")
comment "DotNet 2.0 SP2 not found in registry, starting install dotNetFX3.5"
Message "Installing " + "dotNetFX 2 - 3.5" + " 32 Bit..."
Winbatch_install_dotNet_XP_2-3.5_32
sub_check_exitcode
endif
if (GetRegistryStringValue64("[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{3C3901C5-3455-3E0A-A214-0B093A5070A6}] DisplayName") = "")
comment "DotNet 4.0 not found in registry, starting install dotNetFX4 install"
Message "Installing " + "dotNetFX 4" + " 32 Bit..."
Winbatch_install_dotNet_XP_4_32
sub_check_exitcode
comment "Install Netframework 2.0 - 3.5 for Windows 8"
if ( $MSVersion$ = "6.2" ) and ($win8_net3.5$ = "1") and not (FileExists("%Systemroot%\Microsoft.NET\Framework\v3.5\Microsoft.Build.Tasks.v3.5.dll"))
if (FileExists("%ScriptPath%\X86\net3.5-win8\sources\sxs\amd64_addinprocess32_b77a5c561934e089_6.2.9200.16384_none_d9d957a176ab19d8\addinprocess32.exe"))
Message "Install Netframework 2.0 - 3.5 for Windows 8"
Dosbatch_install_dotNet_2-3.5_8 winst /SysNative
else
LogError "Not compatible without Netframework 3.5 for Windows 8"
isFatalError
endif
endif
@@ -228,7 +164,67 @@ else
comment "Build sereby configuration"
Message "Build sereby configuration"
Dosbatch_build_config winst /64Bit
Dosbatch_build_config winst /SysNative
comment "Choose version to install"
if (($extract_use$ = "1") or (($extract_use$ = "auto") and ($connection_wan$ = "1")))
Message "Installing extracted " + $ProductId$ + " 32 Bit..."
comment "Start extracted setup program"
Dosbatch_install_extracted_32
Sub_check_exitcode
else
Message "Installing " + $ProductId$ + " 32 Bit..."
comment "Start setup program"
Winbatch_install_32
Sub_check_exitcode
endif
comment "Copy files"
Files_install_32 /32Bit
comment "Patch Registry"
Registry_install /32Bit
comment "Create shortcuts"
LinkFolder_install
endif
if ($INST_SystemType$ = "64 Bit System") and (($INST_architecture$ = "system specific") or ($INST_architecture$ = "both") or ($INST_architecture$ = "64 only"))
Message "Installing " + $ProductId$ + " 64 Bit..."
comment "Install Netframework 2.0 - 3.5 for Windows 8"
if ( $MSVersion$ = "6.2" ) and ($win8_net3.5$ = "1") and not (FileExists("%Systemroot%\Microsoft.NET\Framework\v3.5\Microsoft.Build.Tasks.v3.5.dll"))
if (FileExists("%ScriptPath%\X86\net3.5-win8\sources\sxs\amd64_addinprocess32_b77a5c561934e089_6.2.9200.16384_none_d9d957a176ab19d8\addinprocess32.exe"))
Message "Install Netframework 2.0 - 3.5 for Windows 8"
Dosbatch_install_dotNet_2-3.5_8 winst /SysNative
else
LogError "Not compatible without Netframework 3.5 for Windows 8"
isFatalError
endif
endif
comment "Reinstall Java"
if ($java_reinstall$ = "1")
Message "Uninstalling " + "Java" + " 32 + 64 Bit..."
Dosbatch_java_reinstall
endif
comment "Install the extracted version of the sereby packet on opsiserver"
if (($extract_install$ = "1") and not (FileExists("%ScriptPath%\X86\sereby\extracted\WinPKG.exe")))
Message "Installing extracted " + $ProductId$ + " on depotserver..."
Dosbatch_extract_install
endif
comment "Get connection latency between server and client"
if ($extract_use$ = "auto")
Message "Get connection latency..."
Dosbatch_get_connection_latency
Set $Output$ = getOutStreamFromSection('Dosbatch_get_connection_latency')
Set $connection_wan$ = takeFirstStringContaining($Output$, "opsi wan mode : ")
Set $connection_wan$ = TakeString(1, SplitString($connection_wan$, " : "))
endif
comment "Build sereby configuration"
Message "Build sereby configuration"
Dosbatch_build_config winst /SysNative
comment "Choose version to install"
if (($extract_use$ = "1") or (($extract_use$ = "auto") and ($connection_wan$ = "1")))
@@ -256,11 +252,8 @@ else
endif
[Winbatch_install_dotNet_XP_2-3.5_32]
"$Install32_XP1_Exe$"
[Winbatch_install_dotNet_XP_4_32]
"$Install32_XP2_Exe$" /ain
[Dosbatch_install_dotNet_2-3.5_8]
dism /online /enable-feature /featurename:NetFx3 /All /Source:%ScriptPath%\X86\net3.5-win8\sources\sxs /LimitAccess
[Dosbatch_java_reinstall]
cscript /nologo "%ScriptPath%\X86\java\JavaUninstallScript.vbs" /keeponly
@@ -274,13 +267,13 @@ for /f "tokens=2 delims=\" %%a in ('net use p:') do set "opsiservername=%%a"
echo opsi Server: %opsiservername%
@echo off
net use x: \\%opsiservername%\opt_pcbin
net use /delete p:
net use p: /delete /yes
net use p: \\%opsiservername%\opt_pcbin\install
xcopy "%SystemDrive%\AiO-Files\*.*" "%ScriptPath%\X86\sereby\extracted\" /S /E /D /Y
rem rd "%SystemDrive%\AiO-Files" /S /Q
net use /delete p:
rd "%SystemDrive%\AiO-Files" /S /Q
net use p: /delete /yes
net use p: \\%opsiservername%\opsi_depot
net use /delete x:
net use x: /delete /yes
[Dosbatch_get_connection_latency]
@echo off
@@ -298,42 +291,44 @@ if %Latenz% GTR $connection_set_max_latency$ (set wan=1) else (set wan=0)
@echo opsi wan mode : %wan%
[Dosbatch_build_config]
copy "%ScriptPath%\X86\winpkg\WinPKG.xml" "%System%"
copy "%ScriptPath%\X86\winpkg\WinPKG.xml" "$LogDir$"
copy "%System%\WinPKG.xml" "%System%\WinPKG.xml.old"
xml ed -O -u "/settings/timer[@value=40]/@value" -v $timer_value$ "%System%\WinPKG.xml.old" > "%System%\WinPKG.xml"
copy "%System%\WinPKG.xml" "%System%\WinPKG.xml.old"
xml ed -O -u "/settings/timer[@enabled=1]/@enabled" -v $timer_enabled$ "%System%\WinPKG.xml.old" > "%System%\WinPKG.xml"
copy "%System%\WinPKG.xml" "%System%\WinPKG.xml.old"
xml ed -O -u "/settings/set[@component='net1.1']/@checked" -v $inst_net1.1$ "%System%\WinPKG.xml.old" > "%System%\WinPKG.xml"
copy "%System%\WinPKG.xml" "%System%\WinPKG.xml.old"
xml ed -O -u "/settings/set[@component='net2.0']/@checked" -v $inst_net2.0$ "%System%\WinPKG.xml.old" > "%System%\WinPKG.xml"
copy "%System%\WinPKG.xml" "%System%\WinPKG.xml.old"
xml ed -O -u "/settings/set[@component='net3.0']/@checked" -v $inst_net3.0$ "%System%\WinPKG.xml.old" > "%System%\WinPKG.xml"
copy "%System%\WinPKG.xml" "%System%\WinPKG.xml.old"
xml ed -O -u "/settings/set[@component='net3.5']/@checked" -v $inst_net3.5$ "%System%\WinPKG.xml.old" > "%System%\WinPKG.xml"
copy "%System%\WinPKG.xml" "%System%\WinPKG.xml.old"
xml ed -O -u "/settings/set[@component='net4.0']/@checked" -v $inst_net4.0$ "%System%\WinPKG.xml.old" > "%System%\WinPKG.xml"
copy "%System%\WinPKG.xml" "%System%\WinPKG.xml.old"
xml ed -O -u "/settings/set[@component='net4.5']/@checked" -v $inst_net4.5$ "%System%\WinPKG.xml.old" > "%System%\WinPKG.xml"
copy "%System%\WinPKG.xml" "%System%\WinPKG.xml.old"
xml ed -O -u "/settings/set[@component='msjsharp']/@checked" -v $inst_msjsharp$ "%System%\WinPKG.xml.old" > "%System%\WinPKG.xml"
copy "%System%\WinPKG.xml" "%System%\WinPKG.xml.old"
xml ed -O -u "/settings/set[@component='silver']/@checked" -v $inst_silver$ "%System%\WinPKG.xml.old" > "%System%\WinPKG.xml"
copy "%System%\WinPKG.xml" "%System%\WinPKG.xml.old"
xml ed -O -u "/settings/set[@component='jre7']/@checked" -v $inst_jre7$ "%System%\WinPKG.xml.old" > "%System%\WinPKG.xml"
copy "%System%\WinPKG.xml" "%System%\WinPKG.xml.old"
xml ed -O -u "/settings/set[@component='AdobeShock']/@checked" -v $inst_AdobeShock$ "%System%\WinPKG.xml.old" > "%System%\WinPKG.xml"
copy "%System%\WinPKG.xml" "%System%\WinPKG.xml.old"
xml ed -O -u "/settings/set[@component='basicruntimes']/@checked" -v $inst_basicruntimes$ "%System%\WinPKG.xml.old" > "%System%\WinPKG.xml"
copy "%System%\WinPKG.xml" "%System%\WinPKG.xml.old"
xml ed -O -u "/settings/set[@component='msdx9']/@checked" -v $inst_msdx9$ "%System%\WinPKG.xml.old" > "%System%\WinPKG.xml"
copy "%System%\WinPKG.xml" "%System%\WinPKG.xml.old"
xml ed -O -u "/settings/set[@component='msdxm']/@checked" -v $inst_msdxm$ "%System%\WinPKG.xml.old" > "%System%\WinPKG.xml"
copy "%System%\WinPKG.xml" "%System%\WinPKG.xml.old"
xml ed -O -u "/settings/set[@component='msvc']/@checked" -v $inst_msvc$ "%System%\WinPKG.xml.old" > "%System%\WinPKG.xml"
copy "%System%\WinPKG.xml" "%System%\WinPKG.xml.old"
xml ed -O -u "/settings/set[@component='AdobeFlash']/@checked" -v $inst_AdobeFlash$ "%System%\WinPKG.xml.old" > "%System%\WinPKG.xml"
copy "$LogDir$\WinPKG.xml" "$LogDir$\WinPKG.xml.old"
xml ed -O -u "/settings/timer[@value=40]/@value" -v $timer_value$ "$LogDir$\WinPKG.xml.old" > "$LogDir$\WinPKG.xml"
copy "$LogDir$\WinPKG.xml" "$LogDir$\WinPKG.xml.old"
xml ed -O -u "/settings/timer[@enabled=1]/@enabled" -v $timer_enabled$ "$LogDir$\WinPKG.xml.old" > "$LogDir$\WinPKG.xml"
copy "$LogDir$\WinPKG.xml" "$LogDir$\WinPKG.xml.old"
xml ed -O -u "/settings/set[@component='net1.1']/@checked" -v $inst_net1.1$ "$LogDir$\WinPKG.xml.old" > "$LogDir$\WinPKG.xml"
copy "$LogDir$\WinPKG.xml" "$LogDir$\WinPKG.xml.old"
xml ed -O -u "/settings/set[@component='net2.0']/@checked" -v $inst_net2.0$ "$LogDir$\WinPKG.xml.old" > "$LogDir$\WinPKG.xml"
copy "$LogDir$\WinPKG.xml" "$LogDir$\WinPKG.xml.old"
xml ed -O -u "/settings/set[@component='net3.0']/@checked" -v $inst_net3.0$ "$LogDir$\WinPKG.xml.old" > "$LogDir$\WinPKG.xml"
copy "$LogDir$\WinPKG.xml" "$LogDir$\WinPKG.xml.old"
xml ed -O -u "/settings/set[@component='net3.5']/@checked" -v $inst_net3.5$ "$LogDir$\WinPKG.xml.old" > "$LogDir$\WinPKG.xml"
copy "$LogDir$\WinPKG.xml" "$LogDir$\WinPKG.xml.old"
xml ed -O -u "/settings/set[@component='net4.0']/@checked" -v $inst_net4.0$ "$LogDir$\WinPKG.xml.old" > "$LogDir$\WinPKG.xml"
copy "$LogDir$\WinPKG.xml" "$LogDir$\WinPKG.xml.old"
xml ed -O -u "/settings/set[@component='net4.5']/@checked" -v $inst_net4.5$ "$LogDir$\WinPKG.xml.old" > "$LogDir$\WinPKG.xml"
copy "$LogDir$\WinPKG.xml" "$LogDir$\WinPKG.xml.old"
xml ed -O -u "/settings/set[@component='msjsharp']/@checked" -v $inst_msjsharp$ "$LogDir$\WinPKG.xml.old" > "$LogDir$\WinPKG.xml"
copy "$LogDir$\WinPKG.xml" "$LogDir$\WinPKG.xml.old"
xml ed -O -u "/settings/set[@component='silver']/@checked" -v $inst_silver$ "$LogDir$\WinPKG.xml.old" > "$LogDir$\WinPKG.xml"
copy "$LogDir$\WinPKG.xml" "$LogDir$\WinPKG.xml.old"
xml ed -O -u "/settings/set[@component='jre7']/@checked" -v $inst_jre7$ "$LogDir$\WinPKG.xml.old" > "$LogDir$\WinPKG.xml"
copy "$LogDir$\WinPKG.xml" "$LogDir$\WinPKG.xml.old"
xml ed -O -u "/settings/set[@component='AdobeShock']/@checked" -v $inst_AdobeShock$ "$LogDir$\WinPKG.xml.old" > "$LogDir$\WinPKG.xml"
copy "$LogDir$\WinPKG.xml" "$LogDir$\WinPKG.xml.old"
xml ed -O -u "/settings/set[@component='basicruntimes']/@checked" -v $inst_basicruntimes$ "$LogDir$\WinPKG.xml.old" > "$LogDir$\WinPKG.xml"
copy "$LogDir$\WinPKG.xml" "$LogDir$\WinPKG.xml.old"
xml ed -O -u "/settings/set[@component='msdx9']/@checked" -v $inst_msdx9$ "$LogDir$\WinPKG.xml.old" > "$LogDir$\WinPKG.xml"
copy "$LogDir$\WinPKG.xml" "$LogDir$\WinPKG.xml.old"
xml ed -O -u "/settings/set[@component='msdxm']/@checked" -v $inst_msdxm$ "$LogDir$\WinPKG.xml.old" > "$LogDir$\WinPKG.xml"
copy "$LogDir$\WinPKG.xml" "$LogDir$\WinPKG.xml.old"
xml ed -O -u "/settings/set[@component='msvc']/@checked" -v $inst_msvc$ "$LogDir$\WinPKG.xml.old" > "$LogDir$\WinPKG.xml"
copy "$LogDir$\WinPKG.xml" "$LogDir$\WinPKG.xml.old"
xml ed -O -u "/settings/set[@component='AdobeFlash']/@checked" -v $inst_AdobeFlash$ "$LogDir$\WinPKG.xml.old" > "$LogDir$\WinPKG.xml"
move $LogDir$\WinPKG.xml "%System%"
del $LogDir$\WinPKG.xml.old
[Dosbatch_install_extracted_32]
@echo off