Skip to content

Commit 46a9295

Browse files
authored
feat: Skip internet connection wizard on Windows 2000 (#1203)
1 parent a1e6862 commit 46a9295

File tree

1 file changed

+28
-8
lines changed

1 file changed

+28
-8
lines changed

src/define.sh

Lines changed: 28 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1315,11 +1315,19 @@ prepareInstall() {
13151315
if [ -n "$setup" ]; then
13161316

13171317
pid=$(<"$setup")
1318-
pid="${pid:(-4)}"
1319-
pid="${pid:0:3}"
13201318

1321-
if [[ "$pid" == "270" ]]; then
1322-
warn "this version of $desc requires a volume license key (VLK), it will ask for one during installation."
1319+
if [[ "$driver" == "2k" ]]; then
1320+
1321+
echo "${pid:0:$((${#pid})) - 4}270" > "$setup"
1322+
1323+
else
1324+
1325+
pid="${pid:(-4)}"
1326+
1327+
if [[ "${pid:0:3}" == "270" ]]; then
1328+
warn "this version of $desc requires a volume license key (VLK), it will ask for one during installation."
1329+
fi
1330+
13231331
fi
13241332

13251333
fi
@@ -1376,13 +1384,14 @@ prepareInstall() {
13761384

13771385
"2k" )
13781386

1379-
# Windows 2000 Professional x86 generic key
1380-
KEY="G74HG-XXQTJ-RTX64-QKP3F-HKHXP" ;;
1387+
KEY="" ;;
13811388

13821389
* ) error "Unknown version: \"$driver\"" && return 1 ;;
13831390

13841391
esac
13851392

1393+
[ -n "$KEY" ] && KEY="ProductID=$KEY"
1394+
13861395
find "$target" -maxdepth 1 -type f -iname winnt.sif -exec rm {} \;
13871396

13881397
{ echo "[Data]"
@@ -1420,7 +1429,7 @@ prepareInstall() {
14201429
echo " FullName=\"$username\""
14211430
echo " ComputerName=\"*\""
14221431
echo " OrgName=\"Windows for Docker\""
1423-
echo " ProductID=$KEY"
1432+
echo " $KEY"
14241433
echo ""
14251434
echo "[Identification]"
14261435
echo " JoinWorkgroup = WORKGROUP"
@@ -1479,6 +1488,10 @@ prepareInstall() {
14791488
echo "[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer]"
14801489
echo "\"NoWelcomeScreen\"=\"1\""
14811490
echo ""
1491+
echo "[HKEY_CURRENT_USER\Software\Microsoft\Internet Connection Wizard]"
1492+
echo "\"Completed\"=\"1\""
1493+
echo "\"Desktopchanged\"=\"1\""
1494+
echo ""
14821495
echo "[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon]"
14831496
echo "\"AutoAdminLogon\"=\"1\""
14841497
echo "\"DefaultUserName\"=\"$username\""
@@ -1502,11 +1515,18 @@ prepareInstall() {
15021515
echo ""
15031516
} | unix2dos > "$dir/\$OEM\$/install.reg"
15041517

1518+
if [[ "$driver" == "2k" ]]; then
1519+
{ echo "[HKEY_USERS\.DEFAULT\Software\Microsoft\Windows\CurrentVersion\Runonce]"
1520+
echo "\"^SetupICWDesktop\"=-"
1521+
echo ""
1522+
} | unix2dos >> "$dir/\$OEM\$/install.reg"
1523+
fi
1524+
15051525
if [[ "$driver" == "2k3" ]]; then
15061526
{ echo "[HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\srvWiz]"
15071527
echo "@=dword:00000000"
15081528
echo ""
1509-
echo "[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\ServerOOBE\SecurityOOBE]"
1529+
echo "[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\ServerOOBE\SecurityOOBE]"
15101530
echo "\"DontLaunchSecurityOOBE\"=dword:00000000"
15111531
echo ""
15121532
} | unix2dos >> "$dir/\$OEM\$/install.reg"

0 commit comments

Comments
 (0)