-
Postów
649 -
Dołączył
-
Ostatnia wizyta
Odpowiedzi opublikowane przez maggreg
-
-
-
Najnowsza wersja menu.hta wprowadzająca troszkę dynamiki.
Zabawa z dynamiczną zmianą stylów wizualnych przy użyciu VBS.
<HTML> <HEAD> <TITLE>Instalatory</TITLE> <HTA:APPLICATION APPLICATIONNAME="Instalatory" ID="Instalatory" BORDER="dialog" INNERBORDER="no" CAPTION="no" SYSMENU="yes" SCROLL="auto" SINGLEINSTANCE="yes" WINDOWSTATE="maximize" SHOWINTASKBAR="no" CONTEXTMENU="no" NAVIGABLE="yes" SELECTION="no"/> <script language="vbscript" type="text/vbscript"> window.resizeTo 800,600 window.focus </script> <style type="text/css"> body {background-image:url('img\winpe.jpg'); background-repeat:no-repeat; background-attachment:fixed; background-position:center; margin:0px; width:0%; height:100%; left:0%; top:0%; padding:0px; overflow:hidden; z-index:0; font-family:Arial; font-size:20px; font-weight:bold;} #TextArea {font-family:Albertus Medium; font-size:20pt; font-weight:bold; text-align:center; position:absolute; overflow:hidden; width:100%; height:100%; Left:0%; vertical-align:middle; Top:25%;} #menu {border-style:none; position:absolute; overflow:auto; top:5%; height:90%; width:90%; left:5%; right:5%; z-index:2;} p {position:relative; text-align:center; z-index:0;} .button {position:relative; width:325px; font-family:Arial; font-size:12px; font-weight:bold; z-index:2; text-decoration: none; background: #bfb url("img\menu_pionowe_tlo.gif") repeat-x top; color: #254; border-style:ridge; border-left: 1px solid #797;} .button_hover {position:relative; width:325px; font-family:Arial; font-size:12px; font-weight:bold; z-index:2; text-decoration: none; background:url("img\menu_pionowe_tlo2.gif"); color: #bff; background-color: #797; border-style:ridge; padding: 3px;} .button2 {position:relative; width:160px; font-family:Arial; font-size:12px; font-weight:bold; z-index:2; text-decoration: none; background: #bfb url("img\menu_pionowe_tlo.gif") repeat-x top; color: #254; border-style:ridge; border-left: 1px solid #797;} .button2_hover {position:relative; width:160px; font-family:Arial; font-size:12px; font-weight:bold; z-index:2; text-decoration: none; background:url("img\menu_pionowe_tlo2.gif"); color: #bff; background-color: #797; border-style:ridge; padding: 3px;} h2 {position:relative; text-align:center; z-index:0;} </style> </HEAD> <script language="vbscript" type="text/vbscript"> dim system_install, objShell, objWMIService, strDrive, strSystem, objFso, strName dim wim_oembios, wim_massstorage, Wim_name, Wim_index, pliki_oem, plik_unattended, default_key dim strdp, straoems, strunattend, rc_oembios, rc_massstorage, rc_name, rc_index Set objShell = CreateObject("WScript.Shell") Set objFso = CreateObject("Scripting.FileSystemObject") dim arrCommands arrCommands = Split(Instalatory.commandLine, "$") If objShell.Environment("Process").Item("SystemDrive") = "X:" Then objShell.Environment("Process").Item("Temp") = "X:\Windows\Temp" objShell.Environment("Process").Item("Tmp") = "X:\Windows\Temp" If Not objFSO.FolderExists("X:\Windows\System32\config\systemprofile\Desktop") Then objFSO.CreateFolder "X:\Windows\System32\config\systemprofile\Desktop" End If End If Sub Window_onLoad DataArea.InnerHTML = "" TextArea.InnerHTML = "" MENU.InnerHTML = "" MenuSystem End Sub Sub MenuSystem Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2") If objFSO.FileExists(arrCommands(1)&"\repozytorium\455asd8.znk") Then Set folder = objfso.GetFolder(arrCommands(1)&"\repozytorium\systemy") Set files = folder.Files For each folderIdx In files Set objFile = objFSO.OpenTextFile(arrCommands(1)&"\repozytorium\systemy\"& folderIdx.Name,1) strName = split(objFile.ReadAll,vbcrlf) strinstalki_repo_conf = strinstalki_repo_conf & "<input class='button' type='button' onmouseover='MouseOver' onmouseout='MouseOut' value='Zainstaluj "&strName(1)&"' onClick='Install_repo_conf ""&strName(1)&"",""&strName(3)&"",""&strName(5)&"",""&strName(7)&"",""&strName(9)&"",""&strName(11)&""'>Â Â Â " objFile.Close Next strmenurpinstall = "<h2>Instalki oparte na repozytorium z konfiguracją</h2>" & strinstalki_repo_conf End If If objFSO.FileExists(arrCommands(1)&"\wim\455asd8.znk") Then Set folder = objfso.GetFolder(arrCommands(1)&"\wim\systemy") Set files = folder.Files For each folderIdx In files Set objFile = objFSO.OpenTextFile(arrCommands(1)&"\wim\systemy\"& folderIdx.Name,1) strName = split(objFile.ReadAll,vbcrlf) strinstalki_WIM = strinstalki_WIM & "<input class='button' type='button' onmouseover='MouseOver' onmouseout='MouseOut' value='Zainstaluj "&strName(1)&"' onClick='Install_WIM ""&strName(1)&"",""&strName(3)&"",""&strName(5)&"",""&strName(7)&"",""&strName(9)&"",""&strName(11)&"",""&strName(13)&"",""&strName(15)&""'>Â Â Â " objFile.Close Next strmenuwiminstall = "<h2>Instalki oparte na pliku WIM</h2>" & strinstalki_WIM End If strmenu1 = "<input class='button2' onmouseover='MouseOver' onmouseout='MouseOut' type='button' value='Notatnik' onClick='ntp'>Â Â <input class='button2' onmouseover='MouseOver' onmouseout='MouseOut' type='button' value='Taskmgr' onClick='tskmgr'>Â Â <input class='button2' onmouseover='MouseOver' onmouseout='MouseOut' type='button' value='Konsola' onClick='cmd'><br>" strmenu2 = "<input class='button2' onmouseover='MouseOver' onmouseout='MouseOut' type='button' value='Cubic Explorer' onClick='ce'>Â Â <input class='button2' onmouseover='MouseOver' onmouseout='MouseOut' type='button' value='Ghost 32' onClick='ghost'>Â Â <input class='button2' onmouseover='MouseOver' onmouseout='MouseOut' type='button' value='Opera Portable' onClick='Opera'><br>" strmenu3 = "<input class='button2' onmouseover='MouseOver' onmouseout='MouseOut' type='button' value='Start Sieci' onClick='NET'>Â Â <input class='button2' onmouseover='MouseOver' onmouseout='MouseOut' type='button' value='Restart' onClick='wyjscie(2)'>Â Â <input class='button2' onmouseover='MouseOver' onmouseout='MouseOut' type='button' value='Przeładuj' onClick='wyjscie(3)'><br>" strmenu5 = "<br><input class='button2' onmouseover='MouseOver' onmouseout='MouseOut' type='button' value='Quit' onClick='wyjscie(1)'><br>" IF objFSO.FileExists(arrCommands(1)&"\Vista_installer\455asd8.znk") And objFSO.FileExists(arrCommands(1)&"\Seven_Installer\455asd8.znk") Then strmenu4 = "<input class='button' onmouseover='MouseOver' onmouseout='MouseOut' type='button' value='Instalacja systemów Vista lub Server 2008' onClick='Vista_Inst'>Â Â Â <input class='button' onmouseover='MouseOver' onmouseout='MouseOut' type='button' value='Instalacja systemów Seven lub Server 2008 R2' onClick='Seven_Inst'>" strmenuvistainstall = "<h2>Instalki systemów z lini Vista i Seven</h2>" & strmenu4 ElseIf objFSO.FileExists(arrCommands(1)&"\Seven_Installer\455asd8.znk") Then strmenu4 = "<input class='button' onmouseover='MouseOver' onmouseout='MouseOut' type='button' value='Instalacja systemów Seven lub Server 2008 R2' onClick='Seven_Inst'>" strmenuvistainstall = "<h2>Instalki systemów z lini Seven</h2>" & "<p>" & strmenu4 & "</p>" ElseIf objFSO.FileExists(arrCommands(1)&"\Vista_installer\455asd8.znk") Then strmenu4 = "<input class='button' onmouseover='MouseOver' onmouseout='MouseOut' type='button' value='Instalacja systemów Vista lub Server 2008' onClick='Vista_Inst'>" strmenuvistainstall = "<h2>Instalki systemów z lini Vista</h2>" & "<p>" & strmenu4 & "</p>" End If MENU.InnerHTML = "<p>" & strmenurpinstall & "</p>" & "<p>" & strmenuwiminstall & "</p>" & "<p>" & strmenuvistainstall & "</p>" & "<h2>Narzędzia</h2>" & "<p>" & strmenu1 & strmenu2 & strmenu3 & strmenu5 & "</p>" End Sub Sub Install_WIM(system,arg_1,arg_2,arg_3,arg_4,arg_5,arg_6,arg_7) Window.resizeTo 800,350 MENU.InnerHTML = "" DataArea.InnerHTML = "" TextArea.InnerHTML = "" On Error Resume Next Set colDisks = objWMIService.ExecQuery("Select * from Win32_LogicalDisk Where (DriveType = 3 OR DriveType = 2) AND DeviceID <> 'A:' AND DeviceID <> 'X:' AND DeviceID <> '" & arrCommands(1) & "'") 'Set colDisks = objWMIService.ExecQuery("Select * from Win32_LogicalDisk Where DriveType = 3 AND DeviceID <> 'x:' AND DeviceID <> '" & arrCommands(1) & "'") For Each objDisk in colDisks strBody4 = strBody4 & "<option value='"& objDisk.DeviceID &"'>"& objDisk.DeviceID &"</option>" Next set colSubfolders = objWMIService.ExecQuery("Associators of {Win32_Directory.Name='"&arrCommands(1)&"\"&arg_3&"'} Where AssocClass = Win32_Subdirectory ResultRole = PartComponent") For Each objFolder in colSubfolders strBody5 = strBody5 & "<option value='"&arrCommands(1)&"\"&arg_3&"\"&objFolder.fileName&"'>"& objFolder.fileName &"</option>" Next Set colSubfolders = objWMIService.ExecQuery("Associators of {Win32_Directory.Name='"&arrCommands(1)&"\"&arg_4&"'} Where AssocClass = Win32_Subdirectory ResultRole = PartComponent") For Each objFolder in colSubfolders strBody6 = strBody6 & "<option value='"&arrCommands(1)&"\"&arg_4&"\"&objFolder.fileName&"'>"& objFolder.fileName &"</option>" Next Set folder = objfso.GetFolder(arrCommands(1)&"\wim\pliki\dp") Set files = folder.Files For each folderIdx In files strBody8 = strBody8 & "<option value='"&folderIdx.Name&"'>"& folderIdx.Name &"</option>" Next str0 = "<option value='null'>null</option>" str1 = "<span style='display:inline width:60px; position:absolute; top:15%; left:5%'><select size='1' name='AvailableDrives'>" str2 = "<input class='button' type='button' onmouseover='MouseOver' onmouseout='MouseOut' value='Potwierdź wybór' onClick='sys_inst_WIM' style='left:25%; top:70%; width:125px;'>" str3 = "<input class='button' type='button' onmouseover='MouseOver' onmouseout='MouseOut' value='Rezygnuję' onClick='Cancel' style='left:45%; top:70%; width:125px;'>" str4 = "<span style='display:inline width:60px; position:absolute; top:22%; left:5%'><select size='1' name='AvailableOEMS'>" str5 = "<span style='display:inline width:60px; position:absolute; top:45%; left:5%'><input type='checkbox' name='chkbox1' checked='True'> Nienadzorowana</span>" str6 = "<span style='display:inline width:60px; position:absolute; top:29%; left:5%'><select size='1' name='AvailableMASS'>" str7 = "<span style='display:inline width:60px; position:absolute; top:55%; left:5%'><input type='checkbox' name='chkbox2'> Użyj katalogu $OEM$</span>" str9 = "<span style='display:inline width:60px; position:absolute; top:65%; left:5%'><input type='checkbox' name='chkbox3'> Autorestart</span>" str8 = "<span style='display:inline width:100px; position:absolute; top:36%; left:5%'><select size='1' name='AvailableDP'>" str10 = "<span style='display:inline width:60px; position:absolute; top:75%; left:5%'><input type='checkbox' name='chkbox4'> Użyj klucza domyślnego</span>" DataArea.InnerHTML = "<h2>Instalacja WIM " & system & "</h2>" & str1 & str0 & strBody4 & "</select>" & " Proszę wybrać partycę docelową</Span>" & str4 & str0 & strBody5 & "</select>" & " Proszę wybrać dostawcę OEM</Span>" & str6 & str0 & strBody6 & "</select>" & " Proszę wybrać Sterowniki MassStorage</Span>" & str5 & str8 & str0 & strBody8 & "</select>" & " Proszę wybrać plik konfiguracji dysku</Span>" & str7 & str9 & str10 & str2 & str3 strSystem = system Wim_name = arg_1 Wim_index = arg_2 wim_oembios = arg_3 wim_massstorage = arg_4 pliki_oem = arg_5 plik_unattended = arg_6 default_key = arg_7 End Sub Sub sys_inst_WIM If AvailableDP.Value <> "null" Then strDrive = "V:" ElseIf AvailableDrives.Value = "null" Then Func_Back_WIM Exit Sub Else strDrive = AvailableDrives.Value End If strMassStorage = AvailableMASS.Value strOEM = AvailableOEMS.Value strDP = AvailableDP.Value if chkbox1.Checked then chkbox1_WIM = "TAK" Set objFile = objFSO.OpenTextFile(arrCommands(1)&"\"&plik_unattended,1,true) strUnAtt = objFile.ReadAll objFile.Close Else if chkbox4.Checked then chkbox4_WIM = "TAK" strdefkey = "[userdata]" & vbCrLf & "productid=" & default_key & vbCrLf & "productkey=" & default_key & vbCrLf end if strUnAtt = "[data]" & vbCrLf & "msdosinitiated=1" & vbCrLf & "floppyless=1" & vbCrLf & "AutoPartition=1" & vbCrLf & "UseSignatures=yes" & vbCrLf & "OriSrc=A:\I386" & vbCrLf & "OriTyp=5" & vbCrLf strnonunat = "[unattended]" & vbCrLf & "OemPreinstall=Yes" &vbCrLf& "DriverSigningPolicy=Ignore" &vbCrLf end If if chkbox2.Checked then chkbox2_WIM = "TAK" end if if chkbox3.Checked then chkbox3_WIM = "TAK" end if DataArea.InnerHTML = "" TextArea.InnerHTML = "" window.resizeTo 768,120 TextArea.InnerHTML = "Proszę czekać,<br>trwa Instalacja " & strSystem If strdp <> "null" Then objShell.run ("%comspec% /c diskpart /s "&chr(34)&arrCommands(1)&"\wim\pliki\DP\"&strDP&chr(34)),0,true Else set colVolumes = objWMIService.ExecQuery("select * from Win32_Volume Where Name = '"&strDrive&"\\'") For Each objVolume in colVolumes objVolume.Format "NTFS",True,,"",False If Not objFSO.FileExists("x:\windows\temp\dp.txt") Then Set objFile = objFSO.CreateTextFile("x:\windows\temp\dp.txt", True) objFile.WriteLine "select volume " & strDrive & vbCrLf & "active" & vbCrLf & "exit" objFile.close End If objShell.Run ("%comspec% /c diskpart /s x:\windows\temp\dp.txt"),0,true objFSO.DeleteFile "x:\windows\temp\dp.txt" Next End If objShell.run ("bootsect.exe /nt52 " & strDrive & " /force /mbr"),0,true objShell.run ("imagex.exe /apply "&arrCommands(1)&"\wim\"&Wim_name&" "&Wim_index&" "&strDrive),0,true Set objFile = objFSO.CreateTextFile(strDrive&"\$WIN_NT$.~BT\winnt.sif",true) objFile.Write strUnAtt & strdefkey objFile.Close 'objShell.run ("wpeutil.exe reboot"),0,false if chkbox2_WIM = "TAK" then objFso.CopyFolder arrCommands(1)&"\"&pliki_oem, strDrive&"\$WIN_NT$.~LS\$OEM$", True end if If strOEM <> "null" Then objFSO.CopyFile strOEM&"\*", strDrive&"\$WIN_NT$.~LS\I386\", True End IF If strMassStorage <> "null" Then Set objFile = objFSO.OpenTextFile(strMassStorage&"\untd.txt",1,true) strMass = objFile.ReadAll objFile.close Set objFile = objFSO.CreateTextFile(strDrive&"\$WIN_NT$.~BT\winnt.sif",true) objFile.Write strUnAtt & strnonunat & strdefkey & strMass objFile.Close If Not objFso.FolderExists(strDrive&"\$WIN_NT$.~LS\$OEM$") Then Set f = objFso.CreateFolder(strDrive&"\$WIN_NT$.~LS\$OEM$") End If Set f = Nothing objFso.CopyFolder strMassStorage&"\txtsetup", strDrive&"\$WIN_NT$.~LS\$OEM$\TEXTMODE", True objFso.CopyFolder strMassStorage&"\txtsetup", strDrive&"\$WIN_NT$.~BT\$OEM$", True End If IF chkbox3_Wim = "TAK" then objShell.Run ("Wpeutil Reboot"),0,false End If window.resizeTo 800,600 MenuSystem DataArea.InnerHTML = "" TextArea.InnerHTML = "" End sub Sub Func_Back_WIM DataArea.InnerHTML = "" TextArea.InnerHTML = "" window.resizeTo 512,120 strbck1 = "<input class='button' type='button' onmouseover='MouseOver' onmouseout='MouseOut' value='Wróć' onClick='Install_WIM ""&strSystem&"",""&Wim_name&"",""&Wim_index&"",""&wim_oembios&"",""&wim_massstorage&"",""&pliki_oem&"",""&plik_unattended&"",""&default_key&""' style='left:5%; top:65%; width:125px;'>" strbck2 = "<input class='button' type='button' onmouseover='MouseOver' onmouseout='MouseOut' value='Diskpart' onClick='diskpart' style='left:10%; top:65%; width:125px;'>" strbck3 = "<input class='button' type='button' onmouseover='MouseOver' onmouseout='MouseOut' value='Rezygnuję' onClick='Cancel' style='left:15%; top:65%; width:125px;'>" TextArea.InnerHTML = "Nie wybrano partycji docelowej" DataArea.InnerHTML = strbck1 & strbck2 & strbck3 End Sub Sub Install_repo_conf(system,arg_1,arg_2,arg_3,arg_4,arg_5) Window.resizeTo 800,350 MENU.InnerHTML = "" DataArea.InnerHTML = "" TextArea.InnerHTML = "" On Error Resume Next Set colDisks = objWMIService.ExecQuery("Select * from Win32_LogicalDisk Where (DriveType = 3 OR DriveType = 2) AND DeviceID <> 'A:' AND DeviceID <> 'X:' AND DeviceID <> '" & arrCommands(1) & "'") For Each objDisk in colDisks strBody4 = strBody4 & "<option value='"& objDisk.DeviceID &"'>"& objDisk.DeviceID &"</option>" Next set colSubfolders = objWMIService.ExecQuery("Associators of {Win32_Directory.Name='"&arrCommands(1)&"\"&arg_2&"'} Where AssocClass = Win32_Subdirectory ResultRole = PartComponent") For Each objFolder in colSubfolders strBody5 = strBody5 & "<option value='"&arrCommands(1)&"\"&arg_2&"\"&objFolder.fileName&"'>"& objFolder.fileName &"</option>" Next Set colSubfolders = objWMIService.ExecQuery("Associators of {Win32_Directory.Name='"&arrCommands(1)&"\"&arg_3&"'} Where AssocClass = Win32_Subdirectory ResultRole = PartComponent") For Each objFolder in colSubfolders strBody6 = strBody6 & "<option value='"&arrCommands(1)&"\"&arg_3&"\"&objFolder.fileName&"'>"& objFolder.fileName &"</option>" Next Set folder = objfso.GetFolder(arrCommands(1)&"\repozytorium\pliki\dp") Set files = folder.Files For each folderIdx In files strBody8 = strBody8 & "<option value='"&folderIdx.Name&"'>"& folderIdx.Name &"</option>" Next str0 = "<option value='null'>null</option>" str1 = "<span style='display:inline width:60px; position:absolute; top:15%; left:5%'><select size='1' name='AvailableDrives'>" str2 = "<input class='button' type='button' onmouseover='MouseOver' onmouseout='MouseOut' value='Potwierdź wybór' onClick='sys_inst_repo_conf' style='left:25%; top:60%; width:125px;'>" str3 = "<input class='button' type='button' onmouseover='MouseOver' onmouseout='MouseOut' value='Rezygnuję' onClick='Cancel' style='left:45%; top:60%; width:125px;'>" str4 = "<span style='display:inline width:60px; position:absolute; top:22%; left:5%'><select size='1' name='AvailableOEMS'>" str5 = "<span style='display:inline width:60px; position:absolute; top:45%; left:5%'><input type='checkbox' name='chkbox1' checked='True'> Nienadzorowana</span>" str6 = "<span style='display:inline width:60px; position:absolute; top:29%; left:5%'><select size='1' name='AvailableMASS'>" str7 = "<span style='display:inline width:60px; position:absolute; top:55%; left:5%'><input type='checkbox' name='chkbox2'> Użyj katalogu $OEM$</span>" str9 = "<span style='display:inline width:60px; position:absolute; top:65%; left:5%'><input type='checkbox' name='chkbox3'> Autorestart</span>" str8 = "<span style='display:inline width:100px; position:absolute; top:36%; left:5%'><select size='1' name='AvailableDP'>" DataArea.InnerHTML = "<h2>Instalacja repozytorium z konfiguracją " & system & "</h2>" & str1 & str0 & strBody4 & "</select>" & " Proszę wybrać partycę docelową</Span>" & str4 & str0 & strBody5 & "</select>" & " Proszę wybrać dostawcę OEM</Span>" & str6 & str0 & strBody6 & "</select>" & " Proszę wybrać Sterowniki MassStorage</Span>" & str5 & str8 & str0 & strBody8 & "</select>" & " Proszę wybrać plik konfiguracji dysku</Span>" & str7 & str9 & str10 & str2 & str3 strSystem = system rc_name = arg_1 rc_oembios = arg_2 rc_massstorage = arg_3 pliki_oem = arg_4 plik_unattended = arg_5 End Sub Sub sys_inst_repo_conf If AvailableDP.Value <> "null" Then strDrive = "V:" ElseIf AvailableDrives.Value = "null" Then Func_Back_repo_conf Exit Sub Else strDrive = AvailableDrives.Value End If strMassStorage = AvailableMASS.Value strOEM = AvailableOEMS.Value strDP = AvailableDP.Value if chkbox1.Checked then chkbox1_rc = "TAK" strunattended = " /unattend:" & arrCommands(1)&"\"&plik_unattended Set objFile = objFSO.OpenTextFile(arrCommands(1)&"\"&plik_unattended,1,true) strUnAtt = objFile.ReadAll objFile.Close Else strnonunat = "[unattended]" & vbCrLf & "OemPreinstall=Yes" &vbCrLf& "DriverSigningPolicy=Ignore" &vbCrLf end If if chkbox2.Checked then chkbox2_rc = "TAK" end if if chkbox3.Checked then chkbox3_rc = "TAK" end if DataArea.InnerHTML = "" TextArea.InnerHTML = "" window.resizeTo 768,120 TextArea.InnerHTML = "Proszę czekać,<br>trwa Instalacja " & strSystem If strdp <> "null" Then objShell.run ("%comspec% /c diskpart /s "&chr(34)&arrCommands(1)&"\repozytorium\pliki\DP\"&strDP&chr(34)),0,true Else set colVolumes = objWMIService.ExecQuery("select * from Win32_Volume Where Name = '"&strDrive&"\\'") For Each objVolume in colVolumes objVolume.Format "NTFS",True,,"",False If Not objFSO.FileExists("x:\windows\temp\dp.txt") Then Set objFile = objFSO.CreateTextFile("x:\windows\temp\dp.txt", True) objFile.WriteLine "select volume " & strDrive & vbCrLf & "active" & vbCrLf & "exit" objFile.close End If objShell.Run ("%comspec% /c diskpart /s x:\windows\temp\dp.txt"),0,true objFSO.DeleteFile "x:\windows\temp\dp.txt" Next End If objShell.run ("bootsect.exe /nt52 " & strDrive & " /force /mbr"),0,true objShell.run (arrCommands(1) & "\repozytorium\instalatory\"&rc_name&"\i386\winnt32.exe /makelocalsource /noreboot /syspart:" & strDrive & " /tempdrive:" & strDrive &strunattended),0,true if chkbox2_rc = "TAK" then objFso.CopyFolder arrCommands(1)&"\"&pliki_oem, strDrive&"\$WIN_NT$.~LS\$OEM$", True end if If strOEM <> "null" Then objFSO.CopyFile strOEM&"\*", strDrive&"\$WIN_NT$.~LS\I386\", True End IF If strMassStorage <> "null" Then Set objFile = objFSO.OpenTextFile(strDrive&"\$WIN_NT$.~BT\winnt.sif",1,true) strUnAtt = objFile.ReadAll objFile.Close Set objFile = objFSO.OpenTextFile(strMassStorage&"\untd.txt",1,true) strMass = objFile.ReadAll objFile.close Set objFile = objFSO.CreateTextFile(strDrive&"\$WIN_NT$.~BT\winnt.sif",true) objFile.Write strUnAtt & strnonunat & strMass objFile.Close If Not objFso.FolderExists(strDrive&"\$WIN_NT$.~LS\$OEM$") Then Set f = objFso.CreateFolder(strDrive&"\$WIN_NT$.~LS\$OEM$") End If Set f = Nothing objFso.CopyFolder strMassStorage&"\txtsetup", strDrive&"\$WIN_NT$.~LS\$OEM$\TEXTMODE", True objFso.CopyFolder strMassStorage&"\txtsetup", strDrive&"\$WIN_NT$.~BT\$OEM$", True End If IF chkbox3_rc = "TAK" then objShell.Run ("Wpeutil Reboot"),0,false End If window.resizeTo 800,600 MenuSystem DataArea.InnerHTML = "" TextArea.InnerHTML = "" End sub Sub Func_Back_repo_conf DataArea.InnerHTML = "" TextArea.InnerHTML = "" window.resizeTo 512,120 strbck1 = "<input class='button' type='button' onmouseover='MouseOver' onmouseout='MouseOut' value='Wróć' onClick='install_repo_conf ""&strSystem&"",""&rc_name&"",""&rc_oembios&"",""&rc_massstorage&"",""&pliki_oem&"",""&plik_unattended&""' style='left:5%; top:65%; width:125px;'>" strbck2 = "<input class='button' type='button' onmouseover='MouseOver' onmouseout='MouseOut' value='Diskpart' onClick='diskpart' style='left:10%; top:65%; width:125px;'>" strbck3 = "<input class='button' type='button' onmouseover='MouseOver' onmouseout='MouseOut' value='Rezygnuję' onClick='Cancel' style='left:15%; top:65%; width:125px;'>" TextArea.InnerHTML = "Nie wybrano partycji docelowej" DataArea.InnerHTML = strbck1 & strbck2 & strbck3 End Sub Sub Vista_Inst Window.resizeTo 750,250 MENU.InnerHTML = "" DataArea.InnerHTML = "" TextArea.InnerHTML = "" On Error Resume Next Set folder = objfso.GetFolder(arrCommands(1)&"\vista_Installer\vista_unattend") Set files = folder.Files For each folderIdx In files strBody42 = strBody42 & "<option value='"&folderIdx.Name&"'>"& folderIdx.Name &"</option>" Next Set colSubfolders = objWMIService.ExecQuery("Associators of {Win32_Directory.Name='"&arrCommands(1)&"\vista_Installer\vista_unattend\AOems'} Where AssocClass = Win32_Subdirectory ResultRole = PartComponent") For Each objFolder in colSubfolders strBody45 = strBody45 & "<option value='"&objFolder.Name&"'>"& objFolder.fileName &"</option>" Next Set folder = objfso.GetFolder(arrCommands(1)&"\vista_Installer\vista_unattend\dp") Set files = folder.Files For each folderIdx In files strBody48 = strBody48 & "<option value='"&folderIdx.Name&"'>"& folderIdx.Name &"</option>" Next str40 = "<option value='null'>null</option>" str41 = "<span style='display:inline width:60px; position:absolute; top:15%; left:5%'><select size='1' name='AvailableUnattend'>" str43 = "<input class='button' type='button' onmouseover='MouseOver' onmouseout='MouseOut' value='Potwierdź wybór' onClick='Vista_Instal' style='left:25%; top:50%; width:125px;'>" str44 = "<input class='button' type='button' onmouseover='MouseOver' onmouseout='MouseOut' value='Rezygnuję' onClick='Cancel' style='left:35%; top:50%; width:125px;'>" str46 = "<span style='display:inline width:80px; position:absolute; top:30%; left:5%'><select size='1' name='AvailableAOems'>" str47 = "<span style='display:inline width:60px; position:absolute; top:60%; left:5%'><input type='checkbox' name='chkbox1'> Autorestart</span>" str48 = "<span style='display:inline width:100px; position:absolute; top:45%; left:5%'><select size='1' name='AvailableDP'>" DataArea.InnerHTML = "<h2>Instalacja Systemu Vista lub Server 2008</h2>" & str41 & str40 & strBody42 & "</select>" & " Proszę wybrać plik instalacji nienadzorowanej</Span>" & str46 & str40 & strBody45 & "</select>" & " Proszę wybrać Alternatywny katalog $OEM$</Span>" & str48 & str40 & strBody48 & "</select>" & " Proszę wybrać skrypt przygotowujący dysk</Span>" & str47 & str43 & str44 End Sub Sub Vista_Instal strunattend = AvailableUnattend.Value straoems = AvailableAOems.Value strdp = AvailableDP.Value if chkbox1.Checked then chkbox1_Vista = "TAK" end if MENU.InnerHTML = "" DataArea.InnerHTML = "" TextArea.InnerHTML = "" window.resizeTo 725,160 TextArea.InnerHTML = "Instalacja systemów z lini Vista<br>Windows Vista, Serwer 2008" If strdp <> "null" Then objShell.run ("%comspec% /c" & "diskpart /s "&chr(34)&arrCommands(1)&"\vista_Installer\vista_unattend\DP\"&strDP&chr(34)),0,true End If If strunattend = "null" AND straoems = "null" Then objShell.run (arrCommands(1) & "\vista_Installer\setup.exe /noreboot"),0,true ElseIF strunattend <> "null" AND straoems = "null" Then objShell.run (arrCommands(1) & "\vista_Installer\setup.exe /noreboot /unattend:"&arrCommands(1)&"\vista_Installer\vista_unattend\"&strunattend),0,true ElseIF strunattend = "null" AND straoems <> "null" Then objShell.run (arrCommands(1) & "\vista_Installer\setup.exe /noreboot /m:"&straoems),0,true Else objShell.run (arrCommands(1) & "\vista_Installer\setup.exe /noreboot /m:"&straoems&" /unattend:"&arrCommands(1)&"\vista_Installer\vista_unattend\"&strunattend),0,true End If IF chkbox1_Vista = "TAK" then window.close() End If window.resizeTo 1024,768 MenuSystem TextArea.InnerHTML = "" End Sub Sub Seven_Inst Window.resizeTo 750,250 MENU.InnerHTML = "" DataArea.InnerHTML = "" TextArea.InnerHTML = "" On Error Resume Next Set folder = objfso.GetFolder(arrCommands(1)&"\seven_Installer\seven_unattend") Set files = folder.Files For each folderIdx In files strBody22 = strBody22 & "<option value='"&folderIdx.Name&"'>"& folderIdx.Name &"</option>" Next Set colSubfolders = objWMIService.ExecQuery("Associators of {Win32_Directory.Name='"&arrCommands(1)&"\seven_Installer\seven_unattend\AOems'} Where AssocClass = Win32_Subdirectory ResultRole = PartComponent") For Each objFolder in colSubfolders strBody25 = strBody25 & "<option value='"&objFolder.Name&"'>"& objFolder.FileName &"</option>" Next Set folder = objfso.GetFolder(arrCommands(1)&"\seven_Installer\seven_unattend\dp") Set files = folder.Files For each folderIdx In files strBody28 = strBody28 & "<option value='"&folderIdx.Name&"'>"& folderIdx.Name &"</option>" Next str20 = "<option value='null'>null</option>" str21 = "<span style='display:inline width:60px; position:absolute; top:15%; left:5%'><select size='1' name='AvailableUnattend'>" str23 = "<input class='button' type='button' onmouseover='MouseOver' onmouseout='MouseOut' value='Potwierdź wybór' onClick='Seven_Instal' style='left:25%; top:50%; width:125px;'>" str24 = "<input class='button' type='button' onmouseover='MouseOver' onmouseout='MouseOut' value='Rezygnuję' onClick='Cancel' style='left:35%; top:50%; width:125px;'>" str26 = "<span style='display:inline width:80px; position:absolute; top:30%; left:5%'><select size='1' name='AvailableAOems'>" str27 = "<span style='display:inline width:60px; position:absolute; top:60%; left:5%'><input type='checkbox' name='chkbox1'> Autorestart</span>" str28 = "<span style='display:inline width:100px; position:absolute; top:45%; left:5%'><select size='1' name='AvailableDP'>" DataArea.InnerHTML = "<h2>Instalacja Systemu z lini Seven</h2>" & str21 & str20 & strBody22 & "</select>" & " Proszę wybrać plik instalacji nienadzorowanej</Span>" & str26 & str20 & strBody25 & "</select>" & " Proszę wybrać Alternatywny katalog $OEM$</Span>" & str28 & str20 & strBody28 & "</select>" & " Proszę wybrać skrypt przygotowujący dysk</Span>" & str27 & str23 & str24 End Sub Sub Seven_Instal strunattend = AvailableUnattend.Value straoems = AvailableAOems.Value strdp = AvailableDP.Value if chkbox1.Checked then chkbox1_Seven = "TAK" end if MENU.InnerHTML = "" DataArea.InnerHTML = "" TextArea.InnerHTML = "" window.resizeTo 725,160 TextArea.InnerHTML = "Instalacja systemów z lini Seven<br>Windows Seven, Serwer 2008 R2" If strdp <> "null" Then objShell.run ("%comspec% /c" & "diskpart /s "&chr(34)&arrCommands(1)&"\seven_Installer\seven_unattend\DP\"&strDP&chr(34)),0,true End If If strunattend = "null" AND straoems = "null" Then objShell.run (arrCommands(1) & "\seven_Installer\setup.exe /noreboot"),0,true ElseIF strunattend <> "null" AND straoems = "null" Then objShell.run (arrCommands(1) & "\seven_Installer\setup.exe /noreboot /unattend:"&arrCommands(1)&"\seven_Installer\seven_unattend\"&strunattend),0,true ElseIF strunattend = "null" AND straoems <> "null" Then objShell.run (arrCommands(1) & "\seven_Installer\setup.exe /noreboot /m:"&straoems),0,true Else objShell.run (arrCommands(1) & "\seven_Installer\setup.exe /noreboot /m:"&straoems&" /unattend:"&arrCommands(1)&"\seven_Installer\seven_unattend\"&strunattend),0,true End If IF chkbox1_Seven = "TAK" then window.close() End If window.resizeTo 1024,768 MenuSystem TextArea.InnerHTML = "" End Sub sub cancel DataArea.InnerHTML = "" TextArea.InnerHTML = "" window.resizeTo 800,600 MenuSystem end sub Sub ghost MENU.InnerHTML = "" window.resizeTo 512,80 TextArea.InnerHTML = "Uruchomiono Ghost 32" objShell.Run (arrCommands(1) & "\tools\ghost32.exe -prefos"),0,True window.resizeTo 800,600 MenuSystem TextArea.InnerHTML = "" End Sub Sub ntp MENU.InnerHTML = "" window.resizeTo 512,80 TextArea.InnerHTML = "Uruchomiono Notatnik" objShell.Run ("notepad"),1,True window.resizeTo 800,600 MenuSystem TextArea.InnerHTML = "" End Sub Sub cmd MENU.InnerHTML = "" window.resizeTo 512,80 TextArea.InnerHTML = "Uruchomiono Wiersz Poleceń" objShell.Run ("%comspec%"),1,True window.resizeTo 800,600 MenuSystem TextArea.InnerHTML = "" End Sub Sub NET MENU.InnerHTML = "" window.resizeTo 512,80 TextArea.InnerHTML = "Startuje sieć" objShell.Run ("wpeutil InitializeNetwork"),0,True objShell.Run ("wpeutil DisableFirewall"),0,True window.resizeTo 800,600 MenuSystem TextArea.InnerHTML = "" End Sub Sub CE MENU.InnerHTML = "" window.resizeTo 512,80 TextArea.InnerHTML = "Uruchomiono CubicExplorera" objShell.Run (arrCommands(1) & "\tools\CubicExplorerPortable\CubicExplorerPortable.exe"),0,True window.resizeTo 800,600 MenuSystem TextArea.InnerHTML = "" End Sub Sub FC MENU.InnerHTML = "" window.resizeTo 512,80 TextArea.InnerHTML = "Uruchomiono FreeCommandera" objShell.Run (arrCommands(1) & "\tools\FreeCommanderPortable\FreeCommanderPortable.exe"),0,True window.resizeTo 800,600 MenuSystem TextArea.InnerHTML = "" End Sub Sub Opera MENU.InnerHTML = "" window.resizeTo 512,80 TextArea.InnerHTML = "Uruchomiono Operę" objShell.Run (arrCommands(1) & "\tools\OperaPortable\OperaPortable.exe"),0,True window.resizeTo 800,600 MenuSystem TextArea.InnerHTML = "" End Sub Sub tskmgr MENU.InnerHTML = "" window.resizeTo 512,80 TextArea.InnerHTML = "Uruchomiono Menedżer zadań" objShell.Run ("taskmgr"),1,True window.resizeTo 800,600 MenuSystem TextArea.InnerHTML = "" End Sub sub wyjscie(str_str) If str_str = 1 Then window.close() ElseIf str_str = 2 Then objShell.Run ("Wpeutil Reboot"),0,false ElseIf str_str = 3 Then window.parent.location.reload() End If end sub Sub MouseOver Set x = window.event.srcElement x.style.cursor = "HAND" x.className = x.classname & "_hover" End Sub Sub MouseOut Set x = window.event.srcElement x.style.cursor = "default" x.className = split(x.className,"_")(0) End Sub </script> <body id=body> <span id=menu></span> <span id=DataArea></span> <span id=TextArea></span> </body> </HTML>
linki zewnętrzne Menu lub Menu
Menu potrzebuje dodatkowych plików (w katalogu img) graficznych dla batonów. Są to dwa pliki o nazwach: menu_pionowe_tlo.gif (domyślny dla wszystkich batonów) oraz menu_pionowe_tlo2.gif (dla batona wskazanego).
i filmik pokazujący jak to wygląda.
Co prawda kompresja troszkę popsuła efekt (na wszelki wypadek również wersja statyczna) ale myślę, że widać koncepcję, zmienia się nie tylko sam baton ale i kursor .
W załączniku przykładowe pliki graficzne.
pzdr
-
Troszkę to trwało ale wreszcie mogę przedstawić pierwszy z obiecanych filmików:
Część sekcji (tych nudniejszych) została przyspieszona, oryginalnie clip trwał ok. 19 min., myślę że całkiem nieźle jak na w pełni zainstalowany i częściowo skonfigurowany system z dodatkowymi programami, należy również brać poprawkę, że całość odbywała się na maszynie wirtualnej a w tle działał program przechwytujący wideo co miało dodatkowy (negatywny oczywiście) wpływ na szybkość całego procesu.
Rzeczywisty czas będzie zależał oczywiście w dużej mierze od liczby dodatkowo instalowanych programów, ich rodzaju, sterowników dla danej maszyny oraz jej parametrów. Również czas uruchamiania WinPE jest bardzo różny w zależności od płyty głównej, z mojego doświadczenia wynika, że najdłużej trwa to na starszych GigaByte a najszybsze są (w tej akurat dziedzinie) Asrocki, przy czym różnica idzie w minuty.
pzdr
-
Dodanie (chainload) grub4dos do menu bcd jest niezwykle proste, wystarczy dodać odpowiednią pozycję do kontenera, wg dokumentacji Grub4dos:
bcdedit /create /d "GRUB for DOS" /application bootsector bcdedit /set {id} device boot bcdedit /set {id} path \grldr.mbr bcdedit /displayorder {id} /addlast
gdzie id należy zastąpić właściwym wygenerowanym przez pierwszą komendę ciągiem.
Oczywiście działamy na zewnętrznym kontenerze więc właściwie należy podać pełną ścieżkę do bcd:
bcdedit /store x:\boot\bcd /create /d "GRUB for DOS" /application bootsector
Z syslinux-em jest troszkę gorzej, trzeba wygenerować plik odpowiednik botsektora komendą syslinux.exe, jesteśmy też ograniczeni do formatu fat32.
Oczywiście całość można odwrócić i przygotować sobie pen startujący z syslinux-a lub grub-a i z ich poziomu ładować BCD co w przypadku narzędzia wielofunkcyjnego jest wygodniejsze.
W praktyce zresztą najlepiej funkcjonuje zestaw zawierający oba systemy (syslinux i grub) urachamiające siebie wzajemnie, po prostu są przypadki w których jeden sprawdza się lepiej niż drug i vice versa, grub4dos jest natomiast o wiele bardziej uniwersalny, potrafi mapować napędy i emulować obrazy (także iso) bez użycia ramdysku.
Większość odmian live antywirusów jest darmowa nawet kiedy podstawka jest aplikacją komercyjną, w tym przypadku ja od siebie - subiektywnie - mogę polecić BitDefender lub Kaspersky, oczywiście przeniesienie ich na pena wymagać będzie powyżej opisanych zabiegów.
Zastanawiają mnie jednak te polskie znaki, czy jesteś w stanie sprawdzić obraz z pomocą narzędzia DISM (czyli masz dostęp do maszyny z win7 lub z zainstalowanym pakietem waik) ?
pzdr
-
Rozbierzmy po kolei:
Polskie litery do szczęścia potrzebują dwóch "kondycji" - winpe musi być ustawione na wyświetlanie strony kodowej dla europy wschodniej lub unicode (prawidłowo zintegrowane pakiety MUI tego nie gwarantują i dla spełnienia tego warunku nie są tak naprawdę potrzebne), jeżeli używasz winpe załączonego do artykułów powinien spełniać ten wymóg, po drugie sam plik menu.hta powinien być zapisany w czystym windowsowym ansi (nie unicode) z terminatorami CR/LF i oczywiście windowsową stroną kodową, potraktowanie tego pliku edytorem html może to popsuć.
Piszesz, że chce konwertować pena, hm - jakby gdzieś pojawiał się błąd z kolejnością dysków to mogłoby to być możliwe w teorii ale jeżeli dysk/partycja jest widoczny z poziomu winpe nie powinno to mieć miejsca (koniecznie trzeba się upewnić w diskpart, że pen nie jest napędem o numerze zero). Jak przygotowujesz partycję pod instalację? Ze skryptu przez menu czy ręcznie?
Instalka zintegrowana? Co to tak naprawdę znaczy? Podejrzewam, że chodzi o coś sklecone Nlitem. Należy pamiętać, że nie jest to systemowa metoda podawania sterowników massstorage. Sęk w tym, że system takich sterowników szuka w innych katalogach zależnie od etapu instalacji, w etapie tekstowym powinny się one znaleźć w katalogu $WIN_NT$.~BT natomiast dla fazy graficznej w katalogu $WIN_NT$.~LS. Problem w tym, że wszelkie integralki dbają tylko o integrację dla trybu graficznego bo tryb tekstowy w domyśle poszuka ich w katalogu i386 na płycie, niestety taka instalka nie zadziałą nie tylko z pena ale też z płyty puszczona z poziomu Windowsa jeżeli płyta będzie w trakcie instalacji niedostępna. Swego czasu @Picasso podawała sposób odróżnienia plików trafiających do katalogu "BT" wewnątrz pliku txtsetup.sif, są to pliki oznaczone wg paternu [1-9]_|,_[1-9], podejrzewam, że uwzględnienie tego faktu podczas integracji pozwoliłoby obejść problem. Tylko pytanie - po co integrować? Jest to metoda mało elastyczna, jak już pisałem nie koszerna (niezgodna z dokumentacją MS) na dodatek taki system staje się mniej uniwersalny, potrafi spowodować konflikty sprzętowe (np. zintegrowane steru amd na chipie intela potrafio BSOD-zić), lepiej podeprzeć się metodą która obsługuje sam skrypt.
I co znaczy, żeby menu korzystało z txtsetup.sif, jest to plik absolutnie niezbędny do zainstalowania systemu i zapewniam cię, że menu z niego korzysta nawet przy instalacji z plików wim. coś pomyliłeś, ale nie wiem co (może chodzi o winnt.sif?, jeżeli tok to nie ma problemu, jak się ma plik odpowiedzi nazywać definiujesz w konfigu dla danego systemu).
O którego memtesta ci chodzi? memtest86 czy to co jest dostępne z systemem?
W tym drugim przypadku należy zintegrować sobie pakiet recovery z winpe (jak dla mnie zbędny balast a narzędzie memtest w tym wydaniu mało miarodajne).
Instalator Ubuntu (czy jakiegokolwiek innego linuxa) najlepiej dodać sobie w wersji Live do menu startowego z pośrednictwem syslinuxa czy grub4dos, instalatorów windowsowych nie znam (w ogóle brzmi to jak jakaś fanaberia).
Antywirus ma być w wersji live (odpalany z pena) czy do postawienia na systemie?
pzdr
-
Rozwiązałeś wszystkie problemy czy któryś konkretny?
pzdr
-
Jeżeli chodzi o transil to zasadniczo można go całkowicie usunąć, jest to tylko forma zabezpieczenia i do działania dysku nie jest niezbędna.
Oczywiście dobrze jeżeli dysk posiada sprawne zabezpieczenie ale na czas przerzucenia danych usunięcie transila jest całkiem dobrym pomysłem.
Wymiana elektroniki bez przeprogramowania eepromu się nie powiedzie ba może się nawet skończyć parkiem głowic a wtedy odzyskanie tylko w laboratorium.
Proponuję zwrócić się z pytaniem na forum:
http://www.elektroda.pl/rtvforum/forum104.html
lub
Temat typowo skupiony na tej tematyce, wielu obecnych tam użytkowników zajmuje się tą tematyką zawodowo.
pzdr
-
Zacznij od prostej analizy, później ewentualnie przejdź do naprawy zaawansowanej.
Myślę też, że najlepiej użyć wersji z systemu live, dostępna np w pakiecie partedmagic, ostatni gparted live też chyba zawiera.
Jeżeli przejdziesz do etapu instalacji nowego systemu to integracja jest jak najbardziej dobrym pomysłem choć sama (zalecana przez MS) procedura jest lekko praco i czasochłonna. Jeżeli masz dostęp do MSDN (lub kogoś znajomego który ma taką możliwość) to jest już dostępna gotowa wersja zintegrowana do ściągnięcia.
pzdr
-
Ja bym spróbował jeszcze testdisk-a.
Po pierwsze co wykryje, po drugie odbudowa/zapisanie mbr.
pzdr
-
Jestem ciekawy, czy sposób z Partition Logic "+Karolek" byłby skuteczny do postawienia systemu bez CD-ROM. Można by to chyba sprawdzić na maszynie wirtualnej.
Jako, że mam za słabego kompa i za mały HDD nie mam możliwości takiego sprawdzenia. Czy można się do Ciebie uśmiechnąć Picasso w tej sprawie ( ) ?
Problemem będzie (strzelam) brak stacji dyskietek plus ewentualny brak logiki w naszym rozumowaniu.
Sposób z dosowym winnt.exe ogranicza nas do operowania z partycjami fat (fat32) i należy przy tym nadal pamiętać o utworzeniu repozytorium tymczasowego i podaniu źródła instalacji innego niż katalog na CD.
winnt tworzy też plik konwersji nazw z formatu 8.3 - to czasami sprawia kłopot.
Nasuwa się też jedno pytanie- skoro sprzęt potrafi zbotować flopa to czy nie działa plop a co za tym idzie czy nie da się uruchomić mimo wszystko winpe z pena.
Oczywiście czysto teoretycznie bo jak widzimy problem sam się rozwiązał.
pzdr
-
Jeżeli jest możliwość skonfigurowania serwera to najprostszą metodą jest właśnie skorzystanie z PXE, sama konfiguracja specjalnie skomplikowana nie jest.
Natomiast jeżeli można wyjąć dysk i podpiąć pod inną maszynę to ta metoda (zakładając jednostkowy przypadek) jest bardziej logicznym rozwiązaniem, konfiguracja serwera TFTP jest bardziej opłacalna w perspektywie częstszego wykorzystania.
Dysk należy przepiąć tylko na czas pierwszej fazy instalacji, ba - można go nawet podłączyć przez usb, na czas właściwej instalacji dysk wraca do komputera macierzystego.
Pierwsza faza oczywiście z utworzeniem lokalnego repozytorium czyli komenda:
cd d:\i386
winnt32.exe /makelocalsource /syspart:h /tempdrive:h /noreboot
gdzie h: jest partycją na rzeczonym dysku a d:\i386 ścieżką do plików instalacyjnych windowsa.
Przykładowa partycja h: musi mieć oczywiście atrybut botowalnej i zawierać prawidłowy botsektor, w win 7 najlepiej użyć zestawu diskpart + bootsect.exe pod XP natomiast najwygodniejszy będzie mbrwizd.
pzzdr
-
Na pewno instalujesz 11.01, bo w postach cały czas posługujesz się nazwą setupu dla wersji 11.00?
I co z instalacją do innego katalogu niż domyślny (czyli ze świeżą instalacją zamiast upgradu)?
ps
jest jeszcze odrębny setup opery wykorzystywany standardowo przez mechanizm auto update, można go znaleźć na ftp w katalogu: link
Setup należy odpalić wewnątrz katalogu ze starszą wersją opery, wszystkie pliki zostaną do niego rozpakowane.
pzdr
-
Abstrahując zupełnie od potrzeby pozamiatania w systemie spróbuj może z instalacją nowszej wersji :Opera_1101_int_Setup.exe
Ostatnie wersje (choć raczej bety) miewały właśnie problem z instalatorem.
Proponuję też spróbować instalacji do folderu innego niż domyślny (czy ogólnie z innymi ustawieniami).
pzdr
-
Przy okazji dyskusji w temacie Asus Xonar DX Cmudaxp.sys, bsod podczas grania, deinstalacji i dla zadady. założonym przez @Mudin-a nadmieniłem, że mój Xonar ST ma tendencję do zawieszania się po uruchomieniu live linuxa, z reguły samym linuxem da się kartę ożywić jednak właśnie po raz drugi karta zawiesiła mi się permanentnie. Za pierwszym razem kartę odesłaną do serwisu Asus wymienił na całkiem nowy egzemplarz, tym razem postanowiłem kopać troszkę głębiej i znaleźć rozwiązanie.
Zanim przejdę do samej "solucji" może opiszę objawy bo są dość ciekawe, przyczyną są sterowniki Alsa które "psują" wpisy identyfikujące kartę w jej EEpromie.
Karta tak jest widziana przez system co prawda jako urządzenie C-Media 8788, ba da się nawet wymusić instalację sterowników i wg systemu karta działa, niestety jakiekolwiek odtwarzane dzięki nie docierają na wyjścia.
Cechą karty jest charakterystyczny klik załączania przy uruchamianiu systemu którego w wersji "popsutej" nie uświadczymy.
Rozwiązanie:
Istnieje strona z opisem i rozwiązaniem powyższego problemu, pod adresem link znajdziemy programik "restoree" który z poziomu dos-a umożliwia narawę problemu.
W moim przypadku co prawda programik twierdził, że id jest prawidłowy ale po ręcznym wymuszeniu pozwolił poprawić wadliwą wartość.
Po resecie karta uruchamia się poprawnie.
Problem raczej (mam nadzieję) egzotyczny ale postanowiłem go opisać bo jeśli choć jednej osobie oszczędzi nerwów to warto.
pzdr
-
A panowie luknijcie w tą metodę ClearEventLog z konsoli wmic dla przetestowania. Sprawdzenie czy metoda jest zaimplementowana:
wmic path Win32_NetEventLogFile call ClearEventLog /?:full
Jako że z założenia w wmic metoda ma wyczyścić tylko wybrany dziennik zaczołem się bawić i poszło. Wyczyścił wszystkie:
wmic path Win32_NetEventLogFile WHERE FileName!='*' call ClearEventLog
Oczywiście w VBS też można czyścić kompleksowo:
Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate,(Backup)}!\\.\root\cimv2") Set colLogFiles = objWMIService.ExecQuery ("Select * from Win32_NTEventLogFile ") For Each objLogfile in colLogFiles objLogFile.ClearEventLog() Next
Z zastrzeżeniem które podał @Flavius, te metody nie dają dostępu do logów "Dzienniki aplikacji i usług\Microsoft\Windows", nie czyści też logu Setup (ustawienia).
Ja proponuję coś takiego - plik BAT z takim kodem
SC STOP Eventlog
del C:\Winodows\System32\winevt\Logs\*
SC START Eventlog
Będzie problem z usługami zależnymi
ps
@KolegaDudysa - wkradła ci się literówka do > NetEventLogFile
pzdr
-
Ja do czyszczenia logów używam skryptu w vbs.
Odpowiedni fragment wygląda mniej więcej tak:
Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate,(Backup)}!\\.\root\cimv2") Set colLogFiles = objWMIService.ExecQuery ("Select * from Win32_NTEventLogFile " & "Where LogFileName='Application'") For Each objLogfile in colLogFiles objLogFile.ClearEventLog() Next Set colLogFiles = objWMIService.ExecQuery ("Select * from Win32_NTEventLogFile " & "Where LogFileName='System'") For Each objLogfile in colLogFiles objLogFile.ClearEventLog() Next Set colLogFiles = objWMIService.ExecQuery ("Select * from Win32_NTEventLogFile " & "Where LogFileName='Security'") For Each objLogfile in colLogFiles objLogFile.ClearEventLog() Next
pzdr
-
no niestety ja dalej nic nie rozumię i nie dostalem odpowiedzi na moje pytania
Otrzymałeś, sęk w tym, że nie chcesz spróbować z nich skorzystać.
pzdr
-
Ponieważ właśnie mi się skojarzyło, że jeżeli katalog boot nie będzie zawierał podkatalogu fonts a w nim pliku wgl4_boot.ttf to również (przynajmniej WinPE) nie będzie pokazywało polskiego komunikatu startowego.
Zagadnienie samo w sobie na tyle proste, że nie widzę potrzeby prowadzenia kogokolwiek "za rączkę".
pzdr
-
Bez specjalnego sterownika Windows nie jest w stanie zobaczyć takiej drugiej partycji, chyb że firmware samego pena obsługuje coś kiego jak partycja szyfrowana itp., ale i tak nie jest to 100% odpowiednik standardowej partycji.
Pewnym rozwiązaniem wydzielenie części pena do oddzielnego urządzenia z tym, że najczęściej w tym przypadku mamy emulację usb cd/dvd i z małymi wyjątkami wymaga to użycia oprogramowania serwisowego co może się skończyć uśmierceniem gwizdka.
Jeżeli nie odstrasza cię grażdanka to zapraszam na stronę: http://flashboot.ru/ gdzie można znaleźć wiele programów do tego celów i odpowiednich poradników.
pzdr
-
Notatnik jest uzależniony od systemowego ustawienia ukrywania plików, w winpe domyślnie pliki systemowe nie są odsłonięte, oczywiście nie oznacza to, że ich nie ma.
Proponuję z konsoli wydać dla danego folderu polecenie dir z argumentem "/a" i wtedy zobaczyć co się pokaże.
Sam bootsect.exe powinien się znaleźć w katalogu boot na płycie instalacyjnej siódemki, jest też składnikiem pakiety waik, zawsze też można ściągnąć z mojego wątku w tutorialach paczkę która zawiera między innymi rzeczony plik.
pzdr
-
bootsect nie jest domyślnie dostępnym programem w systemie ani na winpe, należy go sobie dorzucić bąć uruchomić z zewnętrznego źródła, alternatywnie pracując na XP można skorzystać z programiku mbrwizd (w wersji konsolowej) który także jest w stanie ustawić prawidłowy botsektor.
Co znaczy, że nie są widoczne wszystkie pliki, w jaki sposób to sprawdzasz, przecież Vista Recovery nie posiada powłoki graficznej?
pzdr
-
W poście #78 link znajduje się opis skryptu konsolidującego wszystkie wcześniejsze zestawy razem, dopiero to jest tak naprawdę docelowy (i wg mnie jedynie słuszny) zestaw.
A oto sam skrypt:
<HEAD> <TITLE>Instalatory</TITLE> <HTA:APPLICATION APPLICATIONNAME="Instalatory" ID="Instalatory" BORDER="none" INNERBORDER="no" CAPTION="no" SYSMENU="no" SCROLL="auto" SINGLEINSTANCE="yes" WINDOWSTATE="maximize" SHOWINTASKBAR="no" CONTEXTMENU="no" NAVIGABLE="yes" SELECTION="no"/> <script language="vbscript" type="text/vbscript"> window.resizeTo 800,600 window.focus </script> <style type="text/css"> body {background-image:url('img\winpe.jpg'); background-repeat:no-repeat; background-attachment:fixed; background-position:center; margin:0px; width:0%; height:100%; left:0%; top:0%; padding:0px; overflow:hidden; z-index:0; font-family:Arial; font-size:20px; font-weight:bold;} #TextArea {font-family:Albertus Medium; font-size:20pt; font-weight:bold; text-align:center; position:absolute; overflow:hidden; width:100%; height:100%; Left:0%; vertical-align:middle; Top:25%;} #menu {border-style:none; position:absolute; overflow:auto; top:5%; height:90%; width:90%; left:5%; right:5%; z-index:2;} p {position:relative; text-align:center; z-index:0;} .button {background-image:url('img\background.gif'); position:relative; width:325px; color:#000000; font-family:Arial; font-size:12px; font-weight:bold; border-style:ridge; z-index:2;} .button2 {background-image:url('img\background.gif'); position:relative; width:160px; color:#000000; font-family:Arial; font-size:12px; font-weight:bold; border-style:ridge; z-index:2;} h2 {position:relative; text-align:center; z-index:0;} </style> </HEAD> <script language="vbscript" type="text/vbscript"> dim system_install, objShell, objWMIService, strDrive, strSystem, objFso, strName dim wim_oembios, wim_massstorage, Wim_name, Wim_index, pliki_oem, plik_unattended, default_key dim strdp, straoems, strunattend, rc_oembios, rc_massstorage, rc_name, rc_index Set objShell = CreateObject("WScript.Shell") Set objFso = CreateObject("Scripting.FileSystemObject") dim arrCommands arrCommands = Split(Instalatory.commandLine, "$") If objShell.Environment("Process").Item("SystemDrive") = "X:" Then objShell.Environment("Process").Item("Temp") = "X:\Windows\Temp" objShell.Environment("Process").Item("Tmp") = "X:\Windows\Temp" If Not objFSO.FolderExists("X:\Windows\System32\config\systemprofile\Desktop") Then objFSO.CreateFolder "X:\Windows\System32\config\systemprofile\Desktop" End If End If Sub Window_onLoad DataArea.InnerHTML = "" TextArea.InnerHTML = "" MENU.InnerHTML = "" MenuSystem End Sub Sub MenuSystem Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2") If objFSO.FileExists(arrCommands(1)&"\repozytorium\455asd8.znk") Then Set folder = objfso.GetFolder(arrCommands(1)&"\repozytorium\systemy") Set files = folder.Files For each folderIdx In files Set objFile = objFSO.OpenTextFile(arrCommands(1)&"\repozytorium\systemy\"& folderIdx.Name,1) strName = split(objFile.ReadAll,vbcrlf) strinstalki_repo_conf = strinstalki_repo_conf & "<input class='button' type='button' value='Zainstaluj "&strName(1)&"' onClick='Install_repo_conf ""&strName(1)&"",""&strName(3)&"",""&strName(5)&"",""&strName(7)&"",""&strName(9)&"",""&strName(11)&""'> " objFile.Close Next strmenurpinstall = "<h2>Instalki oparte na repozytorium z konfiguracją</h2>" & strinstalki_repo_conf End If If objFSO.FileExists(arrCommands(1)&"\wim\455asd8.znk") Then Set folder = objfso.GetFolder(arrCommands(1)&"\wim\systemy") Set files = folder.Files For each folderIdx In files Set objFile = objFSO.OpenTextFile(arrCommands(1)&"\wim\systemy\"& folderIdx.Name,1) strName = split(objFile.ReadAll,vbcrlf) strinstalki_WIM = strinstalki_WIM & "<input class='button' type='button' value='Zainstaluj "&strName(1)&"' onClick='Install_WIM ""&strName(1)&"",""&strName(3)&"",""&strName(5)&"",""&strName(7)&"",""&strName(9)&"",""&strName(11)&"",""&strName(13)&"",""&strName(15)&""'> " objFile.Close Next strmenuwiminstall = "<h2>Instalki oparte na pliku WIM</h2>" & strinstalki_WIM End If strmenu1 = "<input class='button2' type='button' value='Notatnik' onClick='ntp'> <input class='button2' type='button' value='Taskmgr' onClick='tskmgr'> <input class='button2' type='button' value='Konsola' onClick='cmd'><br>" strmenu2 = "<input class='button2' type='button' value='Free Commander' onClick='fc'> <input class='button2' type='button' value='Ghost 32' onClick='ghost'> <input class='button2' type='button' value='Opera Portable' onClick='Opera'><br>" strmenu3 = "<input class='button2' type='button' value='Start Sieci' onClick='NET'> <input class='button2' type='button' value='Quit' onClick='wyjscie(1)'> <input class='button2' type='button' value='Restart' onClick='wyjscie(2)'><br>" IF objFSO.FileExists(arrCommands(1)&"\Vista_installer\455asd8.znk") And objFSO.FileExists(arrCommands(1)&"\Seven_Installer\455asd8.znk") Then strmenu4 = "<input class='button' type='button' value='Instalacja systemów Vista lub Server 2008' onClick='Vista_Inst'> <input class='button' type='button' value='Instalacja systemów Seven lub Server 2008 R2' onClick='Seven_Inst'>" strmenuvistainstall = "<h2>Instalki systemów z lini Vista i Seven</h2>" & strmenu4 ElseIf objFSO.FileExists(arrCommands(1)&"\Seven_Installer\455asd8.znk") Then strmenu4 = "<input class='button' type='button' value='Instalacja systemów Seven lub Server 2008 R2' onClick='Seven_Inst'>" strmenuvistainstall = "<h2>Instalki systemów z lini Seven</h2>" & "<p>" & strmenu4 & "</p>" ElseIf objFSO.FileExists(arrCommands(1)&"\Vista_installer\455asd8.znk") Then strmenu4 = "<input class='button' type='button' value='Instalacja systemów Vista lub Server 2008' onClick='Vista_Inst'>" strmenuvistainstall = "<h2>Instalki systemów z lini Vista</h2>" & "<p>" & strmenu4 & "</p>" End If MENU.InnerHTML = "<p>" & strmenurpinstall & "</p>" & "<p>" & strmenuwiminstall & "</p>" & "<p>" & strmenuvistainstall & "</p>" & "<h2>Narzędzia</h2>" & "<p>" & strmenu1 & strmenu2 & strmenu3 & "</p>" End Sub Sub Install_WIM(system,arg_1,arg_2,arg_3,arg_4,arg_5,arg_6,arg_7) Window.resizeTo 800,350 MENU.InnerHTML = "" DataArea.InnerHTML = "" TextArea.InnerHTML = "" On Error Resume Next Set colDisks = objWMIService.ExecQuery("Select * from Win32_LogicalDisk Where (DriveType = 3 OR DriveType = 2) AND DeviceID <> 'A:' AND DeviceID <> 'X:' AND DeviceID <> '" & arrCommands(1) & "'") 'Set colDisks = objWMIService.ExecQuery("Select * from Win32_LogicalDisk Where DriveType = 3 AND DeviceID <> 'x:' AND DeviceID <> '" & arrCommands(1) & "'") For Each objDisk in colDisks strBody4 = strBody4 & "<option value='"& objDisk.DeviceID &"'>"& objDisk.DeviceID &"</option>" Next set colSubfolders = objWMIService.ExecQuery("Associators of {Win32_Directory.Name='"&arrCommands(1)&"\"&arg_3&"'} Where AssocClass = Win32_Subdirectory ResultRole = PartComponent") For Each objFolder in colSubfolders strBody5 = strBody5 & "<option value='"&arrCommands(1)&"\"&arg_3&"\"&objFolder.fileName&"'>"& objFolder.fileName &"</option>" Next Set colSubfolders = objWMIService.ExecQuery("Associators of {Win32_Directory.Name='"&arrCommands(1)&"\"&arg_4&"'} Where AssocClass = Win32_Subdirectory ResultRole = PartComponent") For Each objFolder in colSubfolders strBody6 = strBody6 & "<option value='"&arrCommands(1)&"\"&arg_4&"\"&objFolder.fileName&"'>"& objFolder.fileName &"</option>" Next Set folder = objfso.GetFolder(arrCommands(1)&"\wim\pliki\dp") Set files = folder.Files For each folderIdx In files strBody8 = strBody8 & "<option value='"&folderIdx.Name&"'>"& folderIdx.Name &"</option>" Next str0 = "<option value='null'>null</option>" str1 = "<span style='display:inline width:60px; position:absolute; top:15%; left:5%'><select size='1' name='AvailableDrives'>" str2 = "<input class='button' type='button' value='Potwierdź wybór' onClick='sys_inst_WIM' style='left:25%; top:70%; width:125px;'>" str3 = "<input class='button' type='button' value='Rezygnuję' onClick='Cancel' style='left:45%; top:70%; width:125px;'>" str4 = "<span style='display:inline width:60px; position:absolute; top:22%; left:5%'><select size='1' name='AvailableOEMS'>" str5 = "<span style='display:inline width:60px; position:absolute; top:45%; left:5%'><input type='checkbox' name='chkbox1' checked='True'> Nienadzorowana</span>" str6 = "<span style='display:inline width:60px; position:absolute; top:29%; left:5%'><select size='1' name='AvailableMASS'>" str7 = "<span style='display:inline width:60px; position:absolute; top:55%; left:5%'><input type='checkbox' name='chkbox2'> Użyj katalogu $OEM$</span>" str9 = "<span style='display:inline width:60px; position:absolute; top:65%; left:5%'><input type='checkbox' name='chkbox3'> Autorestart</span>" str8 = "<span style='display:inline width:100px; position:absolute; top:36%; left:5%'><select size='1' name='AvailableDP'>" str10 = "<span style='display:inline width:60px; position:absolute; top:75%; left:5%'><input type='checkbox' name='chkbox4'> Użyj klucza domyślnego</span>" DataArea.InnerHTML = "<h2>Instalacja WIM " & system & "</h2>" & str1 & str0 & strBody4 & "</select>" & " Proszę wybrać partycę docelową</Span>" & str4 & str0 & strBody5 & "</select>" & " Proszę wybrać dostawcę OEM</Span>" & str6 & str0 & strBody6 & "</select>" & " Proszę wybrać Sterowniki MassStorage</Span>" & str5 & str8 & str0 & strBody8 & "</select>" & " Proszę wybrać plik konfiguracji dysku</Span>" & str7 & str9 & str10 & str2 & str3 strSystem = system Wim_name = arg_1 Wim_index = arg_2 wim_oembios = arg_3 wim_massstorage = arg_4 pliki_oem = arg_5 plik_unattended = arg_6 default_key = arg_7 End Sub Sub sys_inst_WIM If AvailableDP.Value <> "null" Then strDrive = "V:" ElseIf AvailableDrives.Value = "null" Then Func_Back_WIM Exit Sub Else strDrive = AvailableDrives.Value End If strMassStorage = AvailableMASS.Value strOEM = AvailableOEMS.Value strDP = AvailableDP.Value if chkbox1.Checked then chkbox1_WIM = "TAK" Set objFile = objFSO.OpenTextFile(arrCommands(1)&"\"&plik_unattended,1,true) strUnAtt = objFile.ReadAll objFile.Close Else if chkbox4.Checked then chkbox4_WIM = "TAK" strdefkey = "[userdata]" & vbCrLf & "productid=" & default_key & vbCrLf & "productkey=" & default_key & vbCrLf end if strUnAtt = "[data]" & vbCrLf & "msdosinitiated=1" & vbCrLf & "floppyless=1" & vbCrLf & "AutoPartition=1" & vbCrLf & "UseSignatures=yes" & vbCrLf & "OriSrc=A:\I386" & vbCrLf & "OriTyp=5" & vbCrLf strnonunat = "[unattended]" & vbCrLf & "OemPreinstall=Yes" &vbCrLf& "DriverSigningPolicy=Ignore" &vbCrLf end If if chkbox2.Checked then chkbox2_WIM = "TAK" end if if chkbox3.Checked then chkbox3_WIM = "TAK" end if DataArea.InnerHTML = "" TextArea.InnerHTML = "" window.resizeTo 768,120 TextArea.InnerHTML = "Proszę czekać,<br>trwa Instalacja " & strSystem If strdp <> "null" Then objShell.run ("%comspec% /c diskpart /s "&chr(34)&arrCommands(1)&"\wim\pliki\DP\"&strDP&chr(34)),0,true Else set colVolumes = objWMIService.ExecQuery("select * from Win32_Volume Where Name = '"&strDrive&"\\'") For Each objVolume in colVolumes objVolume.Format "NTFS",True,,"",False If Not objFSO.FileExists("x:\windows\temp\dp.txt") Then Set objFile = objFSO.CreateTextFile("x:\windows\temp\dp.txt", True) objFile.WriteLine "select volume " & strDrive & vbCrLf & "active" & vbCrLf & "exit" objFile.close End If objShell.Run ("%comspec% /c diskpart /s x:\windows\temp\dp.txt"),0,true objFSO.DeleteFile "x:\windows\temp\dp.txt" Next End If objShell.run ("bootsect.exe /nt52 " & strDrive & " /force /mbr"),0,true objShell.run ("imagex.exe /apply "&arrCommands(1)&"\wim\"&Wim_name&" "&Wim_index&" "&strDrive),0,true Set objFile = objFSO.CreateTextFile(strDrive&"\$WIN_NT$.~BT\winnt.sif",true) objFile.Write strUnAtt & strdefkey objFile.Close 'objShell.run ("wpeutil.exe reboot"),0,false if chkbox2_WIM = "TAK" then objFso.CopyFolder arrCommands(1)&"\"&pliki_oem, strDrive&"\$WIN_NT$.~LS\$OEM$", True end if If strOEM <> "null" Then objFSO.CopyFile strOEM&"\*", strDrive&"\$WIN_NT$.~LS\I386\", True End IF If strMassStorage <> "null" Then Set objFile = objFSO.OpenTextFile(strMassStorage&"\untd.txt",1,true) strMass = objFile.ReadAll objFile.close Set objFile = objFSO.CreateTextFile(strDrive&"\$WIN_NT$.~BT\winnt.sif",true) objFile.Write strUnAtt & strnonunat & strdefkey & strMass objFile.Close If Not objFso.FolderExists(strDrive&"\$WIN_NT$.~LS\$OEM$") Then Set f = objFso.CreateFolder(strDrive&"\$WIN_NT$.~LS\$OEM$") End If Set f = Nothing objFso.CopyFolder strMassStorage&"\txtsetup", strDrive&"\$WIN_NT$.~LS\$OEM$\TEXTMODE", True objFso.CopyFolder strMassStorage&"\txtsetup", strDrive&"\$WIN_NT$.~BT\$OEM$", True End If IF chkbox3_Wim = "TAK" then objShell.Run ("Wpeutil Reboot"),0,false End If window.resizeTo 800,600 MenuSystem DataArea.InnerHTML = "" TextArea.InnerHTML = "" End sub Sub Func_Back_WIM DataArea.InnerHTML = "" TextArea.InnerHTML = "" window.resizeTo 512,120 strbck1 = "<input class='button' type='button' value='Wróć' onClick='Install_WIM ""&strSystem&"",""&Wim_name&"",""&Wim_index&"",""&wim_oembios&"",""&wim_massstorage&"",""&pliki_oem&"",""&plik_unattended&"",""&default_key&""' style='left:5%; top:65%; width:125px;'>" strbck2 = "<input class='button' type='button' value='Diskpart' onClick='diskpart' style='left:10%; top:65%; width:125px;'>" strbck3 = "<input class='button' type='button' value='Rezygnuję' onClick='Cancel' style='left:15%; top:65%; width:125px;'>" TextArea.InnerHTML = "Nie wybrano partycji docelowej" DataArea.InnerHTML = strbck1 & strbck2 & strbck3 End Sub Sub Install_repo_conf(system,arg_1,arg_2,arg_3,arg_4,arg_5) Window.resizeTo 800,350 MENU.InnerHTML = "" DataArea.InnerHTML = "" TextArea.InnerHTML = "" On Error Resume Next Set colDisks = objWMIService.ExecQuery("Select * from Win32_LogicalDisk Where (DriveType = 3 OR DriveType = 2) AND DeviceID <> 'A:' AND DeviceID <> 'X:' AND DeviceID <> '" & arrCommands(1) & "'") For Each objDisk in colDisks strBody4 = strBody4 & "<option value='"& objDisk.DeviceID &"'>"& objDisk.DeviceID &"</option>" Next set colSubfolders = objWMIService.ExecQuery("Associators of {Win32_Directory.Name='"&arrCommands(1)&"\"&arg_2&"'} Where AssocClass = Win32_Subdirectory ResultRole = PartComponent") For Each objFolder in colSubfolders strBody5 = strBody5 & "<option value='"&arrCommands(1)&"\"&arg_2&"\"&objFolder.fileName&"'>"& objFolder.fileName &"</option>" Next Set colSubfolders = objWMIService.ExecQuery("Associators of {Win32_Directory.Name='"&arrCommands(1)&"\"&arg_3&"'} Where AssocClass = Win32_Subdirectory ResultRole = PartComponent") For Each objFolder in colSubfolders strBody6 = strBody6 & "<option value='"&arrCommands(1)&"\"&arg_3&"\"&objFolder.fileName&"'>"& objFolder.fileName &"</option>" Next Set folder = objfso.GetFolder(arrCommands(1)&"\repozytorium\pliki\dp") Set files = folder.Files For each folderIdx In files strBody8 = strBody8 & "<option value='"&folderIdx.Name&"'>"& folderIdx.Name &"</option>" Next str0 = "<option value='null'>null</option>" str1 = "<span style='display:inline width:60px; position:absolute; top:15%; left:5%'><select size='1' name='AvailableDrives'>" str2 = "<input class='button' type='button' value='Potwierdź wybór' onClick='sys_inst_repo_conf' style='left:25%; top:60%; width:125px;'>" str3 = "<input class='button' type='button' value='Rezygnuję' onClick='Cancel' style='left:45%; top:60%; width:125px;'>" str4 = "<span style='display:inline width:60px; position:absolute; top:22%; left:5%'><select size='1' name='AvailableOEMS'>" str5 = "<span style='display:inline width:60px; position:absolute; top:45%; left:5%'><input type='checkbox' name='chkbox1' checked='True'> Nienadzorowana</span>" str6 = "<span style='display:inline width:60px; position:absolute; top:29%; left:5%'><select size='1' name='AvailableMASS'>" str7 = "<span style='display:inline width:60px; position:absolute; top:55%; left:5%'><input type='checkbox' name='chkbox2'> Użyj katalogu $OEM$</span>" str9 = "<span style='display:inline width:60px; position:absolute; top:65%; left:5%'><input type='checkbox' name='chkbox3'> Autorestart</span>" str8 = "<span style='display:inline width:100px; position:absolute; top:36%; left:5%'><select size='1' name='AvailableDP'>" DataArea.InnerHTML = "<h2>Instalacja repozytorium z konfiguracją " & system & "</h2>" & str1 & str0 & strBody4 & "</select>" & " Proszę wybrać partycę docelową</Span>" & str4 & str0 & strBody5 & "</select>" & " Proszę wybrać dostawcę OEM</Span>" & str6 & str0 & strBody6 & "</select>" & " Proszę wybrać Sterowniki MassStorage</Span>" & str5 & str8 & str0 & strBody8 & "</select>" & " Proszę wybrać plik konfiguracji dysku</Span>" & str7 & str9 & str10 & str2 & str3 strSystem = system rc_name = arg_1 rc_oembios = arg_2 rc_massstorage = arg_3 pliki_oem = arg_4 plik_unattended = arg_5 End Sub Sub sys_inst_repo_conf If AvailableDP.Value <> "null" Then strDrive = "V:" ElseIf AvailableDrives.Value = "null" Then Func_Back_repo_conf Exit Sub Else strDrive = AvailableDrives.Value End If strMassStorage = AvailableMASS.Value strOEM = AvailableOEMS.Value strDP = AvailableDP.Value if chkbox1.Checked then chkbox1_rc = "TAK" strunattended = " /unattend:" & arrCommands(1)&"\"&plik_unattended Set objFile = objFSO.OpenTextFile(arrCommands(1)&"\"&plik_unattended,1,true) strUnAtt = objFile.ReadAll objFile.Close Else strnonunat = "[unattended]" & vbCrLf & "OemPreinstall=Yes" &vbCrLf& "DriverSigningPolicy=Ignore" &vbCrLf end If if chkbox2.Checked then chkbox2_rc = "TAK" end if if chkbox3.Checked then chkbox3_rc = "TAK" end if DataArea.InnerHTML = "" TextArea.InnerHTML = "" window.resizeTo 768,120 TextArea.InnerHTML = "Proszę czekać,<br>trwa Instalacja " & strSystem If strdp <> "null" Then objShell.run ("%comspec% /c diskpart /s "&chr(34)&arrCommands(1)&"\repozytorium\pliki\DP\"&strDP&chr(34)),0,true Else set colVolumes = objWMIService.ExecQuery("select * from Win32_Volume Where Name = '"&strDrive&"\\'") For Each objVolume in colVolumes objVolume.Format "NTFS",True,,"",False If Not objFSO.FileExists("x:\windows\temp\dp.txt") Then Set objFile = objFSO.CreateTextFile("x:\windows\temp\dp.txt", True) objFile.WriteLine "select volume " & strDrive & vbCrLf & "active" & vbCrLf & "exit" objFile.close End If objShell.Run ("%comspec% /c diskpart /s x:\windows\temp\dp.txt"),0,true objFSO.DeleteFile "x:\windows\temp\dp.txt" Next End If objShell.run ("bootsect.exe /nt52 " & strDrive & " /force /mbr"),0,true objShell.run (arrCommands(1) & "\repozytorium\instalatory\"&rc_name&"\i386\winnt32.exe /makelocalsource /noreboot /syspart:" & strDrive & " /tempdrive:" & strDrive &strunattended),0,true if chkbox2_rc = "TAK" then objFso.CopyFolder arrCommands(1)&"\"&pliki_oem, strDrive&"\$WIN_NT$.~LS\$OEM$", True end if If strOEM <> "null" Then objFSO.CopyFile strOEM&"\*", strDrive&"\$WIN_NT$.~LS\I386\", True End IF If strMassStorage <> "null" Then Set objFile = objFSO.OpenTextFile(strDrive&"\$WIN_NT$.~BT\winnt.sif",1,true) strUnAtt = objFile.ReadAll objFile.Close Set objFile = objFSO.OpenTextFile(strMassStorage&"\untd.txt",1,true) strMass = objFile.ReadAll objFile.close Set objFile = objFSO.CreateTextFile(strDrive&"\$WIN_NT$.~BT\winnt.sif",true) objFile.Write strUnAtt & strnonunat & strMass objFile.Close If Not objFso.FolderExists(strDrive&"\$WIN_NT$.~LS\$OEM$") Then Set f = objFso.CreateFolder(strDrive&"\$WIN_NT$.~LS\$OEM$") End If Set f = Nothing objFso.CopyFolder strMassStorage&"\txtsetup", strDrive&"\$WIN_NT$.~LS\$OEM$\TEXTMODE", True objFso.CopyFolder strMassStorage&"\txtsetup", strDrive&"\$WIN_NT$.~BT\$OEM$", True End If IF chkbox3_rc = "TAK" then objShell.Run ("Wpeutil Reboot"),0,false End If window.resizeTo 800,600 MenuSystem DataArea.InnerHTML = "" TextArea.InnerHTML = "" End sub Sub Func_Back_repo_conf DataArea.InnerHTML = "" TextArea.InnerHTML = "" window.resizeTo 512,120 strbck1 = "<input class='button' type='button' value='Wróć' onClick='install_repo_conf ""&strSystem&"",""&rc_name&"",""&rc_oembios&"",""&rc_massstorage&"",""&pliki_oem&"",""&plik_unattended&""' style='left:5%; top:65%; width:125px;'>" strbck2 = "<input class='button' type='button' value='Diskpart' onClick='diskpart' style='left:10%; top:65%; width:125px;'>" strbck3 = "<input class='button' type='button' value='Rezygnuję' onClick='Cancel' style='left:15%; top:65%; width:125px;'>" TextArea.InnerHTML = "Nie wybrano partycji docelowej" DataArea.InnerHTML = strbck1 & strbck2 & strbck3 End Sub Sub Vista_Inst Window.resizeTo 750,250 MENU.InnerHTML = "" DataArea.InnerHTML = "" TextArea.InnerHTML = "" On Error Resume Next Set folder = objfso.GetFolder(arrCommands(1)&"\vista_Installer\vista_unattend") Set files = folder.Files For each folderIdx In files strBody42 = strBody42 & "<option value='"&folderIdx.Name&"'>"& folderIdx.Name &"</option>" Next Set colSubfolders = objWMIService.ExecQuery("Associators of {Win32_Directory.Name='"&arrCommands(1)&"\vista_Installer\vista_unattend\AOems'} Where AssocClass = Win32_Subdirectory ResultRole = PartComponent") For Each objFolder in colSubfolders strBody45 = strBody45 & "<option value='"&objFolder.Name&"'>"& objFolder.fileName &"</option>" Next Set folder = objfso.GetFolder(arrCommands(1)&"\vista_Installer\vista_unattend\dp") Set files = folder.Files For each folderIdx In files strBody48 = strBody48 & "<option value='"&folderIdx.Name&"'>"& folderIdx.Name &"</option>" Next str40 = "<option value='null'>null</option>" str41 = "<span style='display:inline width:60px; position:absolute; top:15%; left:5%'><select size='1' name='AvailableUnattend'>" str43 = "<input class='button' type='button' value='Potwierdź wybór' onClick='Vista_Instal' style='left:25%; top:50%; width:125px;'>" str44 = "<input class='button' type='button' value='Rezygnuję' onClick='Cancel' style='left:35%; top:50%; width:125px;'>" str46 = "<span style='display:inline width:80px; position:absolute; top:30%; left:5%'><select size='1' name='AvailableAOems'>" str47 = "<span style='display:inline width:60px; position:absolute; top:60%; left:5%'><input type='checkbox' name='chkbox1'> Autorestart</span>" str48 = "<span style='display:inline width:100px; position:absolute; top:45%; left:5%'><select size='1' name='AvailableDP'>" DataArea.InnerHTML = "<h2>Instalacja Systemu Vista lub Server 2008</h2>" & str41 & str40 & strBody42 & "</select>" & " Proszę wybrać plik instalacji nienadzorowanej</Span>" & str46 & str40 & strBody45 & "</select>" & " Proszę wybrać Alternatywny katalog $OEM$</Span>" & str48 & str40 & strBody48 & "</select>" & " Proszę wybrać skrypt przygotowujący dysk</Span>" & str47 & str43 & str44 End Sub Sub Vista_Instal strunattend = AvailableUnattend.Value straoems = AvailableAOems.Value strdp = AvailableDP.Value if chkbox1.Checked then chkbox1_Vista = "TAK" end if MENU.InnerHTML = "" DataArea.InnerHTML = "" TextArea.InnerHTML = "" window.resizeTo 725,160 TextArea.InnerHTML = "Instalacja systemów z lini Vista<br>Windows Vista, Serwer 2008" If strdp <> "null" Then objShell.run ("%comspec% /c" & "diskpart /s "&chr(34)&arrCommands(1)&"\vista_Installer\vista_unattend\DP\"&strDP&chr(34)),0,true End If If strunattend = "null" AND straoems = "null" Then objShell.run (arrCommands(1) & "\vista_Installer\setup.exe /noreboot"),0,true ElseIF strunattend <> "null" AND straoems = "null" Then objShell.run (arrCommands(1) & "\vista_Installer\setup.exe /noreboot /unattend:"&arrCommands(1)&"\vista_Installer\vista_unattend\"&strunattend),0,true ElseIF strunattend = "null" AND straoems <> "null" Then objShell.run (arrCommands(1) & "\vista_Installer\setup.exe /noreboot /m:"&straoems),0,true Else objShell.run (arrCommands(1) & "\vista_Installer\setup.exe /noreboot /m:"&straoems&" /unattend:"&arrCommands(1)&"\vista_Installer\vista_unattend\"&strunattend),0,true End If IF chkbox1_Vista = "TAK" then self.close() End If window.resizeTo 1024,768 MenuSystem TextArea.InnerHTML = "" End Sub Sub Seven_Inst Window.resizeTo 750,250 MENU.InnerHTML = "" DataArea.InnerHTML = "" TextArea.InnerHTML = "" On Error Resume Next Set folder = objfso.GetFolder(arrCommands(1)&"\seven_Installer\seven_unattend") Set files = folder.Files For each folderIdx In files strBody22 = strBody22 & "<option value='"&folderIdx.Name&"'>"& folderIdx.Name &"</option>" Next Set colSubfolders = objWMIService.ExecQuery("Associators of {Win32_Directory.Name='"&arrCommands(1)&"\seven_Installer\seven_unattend\AOems'} Where AssocClass = Win32_Subdirectory ResultRole = PartComponent") For Each objFolder in colSubfolders strBody25 = strBody25 & "<option value='"&objFolder.Name&"'>"& objFolder.FileName &"</option>" Next Set folder = objfso.GetFolder(arrCommands(1)&"\seven_Installer\seven_unattend\dp") Set files = folder.Files For each folderIdx In files strBody28 = strBody28 & "<option value='"&folderIdx.Name&"'>"& folderIdx.Name &"</option>" Next str20 = "<option value='null'>null</option>" str21 = "<span style='display:inline width:60px; position:absolute; top:15%; left:5%'><select size='1' name='AvailableUnattend'>" str23 = "<input class='button' type='button' value='Potwierdź wybór' onClick='Seven_Instal' style='left:25%; top:50%; width:125px;'>" str24 = "<input class='button' type='button' value='Rezygnuję' onClick='Cancel' style='left:35%; top:50%; width:125px;'>" str26 = "<span style='display:inline width:80px; position:absolute; top:30%; left:5%'><select size='1' name='AvailableAOems'>" str27 = "<span style='display:inline width:60px; position:absolute; top:60%; left:5%'><input type='checkbox' name='chkbox1'> Autorestart</span>" str28 = "<span style='display:inline width:100px; position:absolute; top:45%; left:5%'><select size='1' name='AvailableDP'>" DataArea.InnerHTML = "<h2>Instalacja Systemu z lini Seven</h2>" & str21 & str20 & strBody22 & "</select>" & " Proszę wybrać plik instalacji nienadzorowanej</Span>" & str26 & str20 & strBody25 & "</select>" & " Proszę wybrać Alternatywny katalog $OEM$</Span>" & str28 & str20 & strBody28 & "</select>" & " Proszę wybrać skrypt przygotowujący dysk</Span>" & str27 & str23 & str24 End Sub Sub Seven_Instal strunattend = AvailableUnattend.Value straoems = AvailableAOems.Value strdp = AvailableDP.Value if chkbox1.Checked then chkbox1_Seven = "TAK" end if MENU.InnerHTML = "" DataArea.InnerHTML = "" TextArea.InnerHTML = "" window.resizeTo 725,160 TextArea.InnerHTML = "Instalacja systemów z lini Seven<br>Windows Seven, Serwer 2008 R2" If strdp <> "null" Then objShell.run ("%comspec% /c" & "diskpart /s "&chr(34)&arrCommands(1)&"\seven_Installer\seven_unattend\DP\"&strDP&chr(34)),0,true End If If strunattend = "null" AND straoems = "null" Then objShell.run (arrCommands(1) & "\seven_Installer\setup.exe /noreboot"),0,true ElseIF strunattend <> "null" AND straoems = "null" Then objShell.run (arrCommands(1) & "\seven_Installer\setup.exe /noreboot /unattend:"&arrCommands(1)&"\seven_Installer\seven_unattend\"&strunattend),0,true ElseIF strunattend = "null" AND straoems <> "null" Then objShell.run (arrCommands(1) & "\seven_Installer\setup.exe /noreboot /m:"&straoems),0,true Else objShell.run (arrCommands(1) & "\seven_Installer\setup.exe /noreboot /m:"&straoems&" /unattend:"&arrCommands(1)&"\seven_Installer\seven_unattend\"&strunattend),0,true End If IF chkbox1_Seven = "TAK" then self.close() End If window.resizeTo 1024,768 MenuSystem TextArea.InnerHTML = "" End Sub sub cancel DataArea.InnerHTML = "" TextArea.InnerHTML = "" window.resizeTo 800,600 MenuSystem end sub Sub ghost MENU.InnerHTML = "" window.resizeTo 512,80 TextArea.InnerHTML = "Uruchomiono Ghost 32" objShell.Run (arrCommands(1) & "\tools\ghost32.exe -prefos"),0,True window.resizeTo 800,600 MenuSystem TextArea.InnerHTML = "" End Sub Sub ntp MENU.InnerHTML = "" window.resizeTo 512,80 TextArea.InnerHTML = "Uruchomiono Notatnik" objShell.Run ("notepad"),1,True window.resizeTo 800,600 MenuSystem TextArea.InnerHTML = "" End Sub Sub cmd MENU.InnerHTML = "" window.resizeTo 512,80 TextArea.InnerHTML = "Uruchomiono Wiersz Poleceń" objShell.Run ("%comspec%"),1,True window.resizeTo 800,600 MenuSystem TextArea.InnerHTML = "" End Sub Sub NET MENU.InnerHTML = "" window.resizeTo 512,80 TextArea.InnerHTML = "Startuje sieć" objShell.Run ("wpeutil InitializeNetwork"),0,True objShell.Run ("wpeutil DisableFirewall"),0,True window.resizeTo 800,600 MenuSystem TextArea.InnerHTML = "" End Sub Sub FC MENU.InnerHTML = "" window.resizeTo 512,80 TextArea.InnerHTML = "Uruchomiono FreeCommandera" objShell.Run (arrCommands(1) & "\tools\FreeCommanderPortable\FreeCommanderPortable.exe"),0,True window.resizeTo 800,600 MenuSystem TextArea.InnerHTML = "" End Sub Sub Opera MENU.InnerHTML = "" window.resizeTo 512,80 TextArea.InnerHTML = "Uruchomiono Operę" objShell.Run (arrCommands(1) & "\tools\OperaPortable\OperaPortable.exe"),0,True window.resizeTo 800,600 MenuSystem TextArea.InnerHTML = "" End Sub Sub tskmgr MENU.InnerHTML = "" window.resizeTo 512,80 TextArea.InnerHTML = "Uruchomiono Menedżer zadań" objShell.Run ("taskmgr"),1,True window.resizeTo 800,600 MenuSystem TextArea.InnerHTML = "" End Sub sub wyjscie(str_str) If str_str = 1 Then self.close() ElseIf str_str = 2 Then objShell.Run ("Wpeutil Reboot"),0,false End If end sub </script> <body id=body> <span id=menu></span> <span id=DataArea></span> <span id=TextArea></span>
I linki zewnętrzne:
pzdr
-
No i przyszedł czas na dokończenie cyklu. W poście #77 link równoległego wątku znajduje się skrypt służący do budowy menu instalacji systemów linii XP z użyciem repozytorium lokalnego.
Jest to na pewno łatwiejsza do przygotowania wersja tego samego co oferuje instalacja z plików wim. W przeciwieństwie natomiast do plików wim ma ona penwe ograniczenie, nie da si tym sposobem zainstalować windows 2000 (pewnie dla większości z was to żadna wada)
Zarówno struktura katalogów jak i pliki konfiguracyjne są w tym przypadku bardzo podobne do tych zastosowanych w zestawie "wim" choć są pewne różnice.
Oto struktura:
pen - repozytorium - - instalatory - - - XP PRO (np.) - - - - i386 - - pliki - - systemy
Funkcjonalność katalogów "pliki" oraz "systemy" jest identyczna jak wcześniej w przypadku wim natomiast katalog "instalatory" zawiera podkatalogi dedykowane poszczególnym systemom przy czym nazwy katalogów są dowolne, to co pojawi się na batonie obliguje dopiero plik konfiguracyjny, wewnątrz tych katalogów umieszczamy katalog zawierający pliki instalacyjne czyli z definicji i386 w wersji "na żywca" przeniesionej z płyty instalacyjnej.
Jak widać odpada produkcja pliku wim - wystarczy przekopiować odpowiednią zawartość płyty, natomiast zbudowanie pliku konfiguracyjnego jest obligatoryjne, a oto jego składnia:
xp_pro_fixit.txt:
[nazwa] Windows XP PRO SP3 PL FixitPC [repozytorium] xpp_sp3_pl [pliki oembios] repozytorium\pliki\WinXP_fixit\OEM [plik massstorage] repozytorium\pliki\WinXP_fixit\MassStorage [pliki oem] repozytorium\pliki\WinXP_fixit\$OEM$ [nienadzorowana] repozytorium\pliki\WinXP_fixit\unattend_fixit_pro.txt
Po kolei mamy:
[nazwa] - nazwa pod jaką zestaw pojawi się w GUI menu
[repozytorium] - nazwa katalogu zawierającego właściwy folder "i386", katalog podajemy względem folderu "instalatory"
Pozostałe sekcje odpowiadają tym z instalatora wim.
Jak widać brakuje sekcji klucza domyślnego, nie ma w tym przypadku tak prostej metody na jego umieszczenie, ponadto setup i tak zapyta o właściwy serial, można jednak troszkę uprościć sobie instalację umieszczając klucz w pliku pid.inf
Tak jak w przypadku instalatora wim tak i tutaj jednemu zestawowi plików instalacyjnych możemy przypisać wiele różnych konfiguracji, dzięki temu bez marnowania miejsca możemy zastosować różne scenariusze instalacji w zależności od zapotrzebowania.
Niestety ten zestaw posiada pewien mankament, jeżeli setup z jakiegoś powodu napotka błąd w pierwszej fazie bądź też po prostu postanowimy go przerwać skrypt się zawiesi i wygeneruje błąd, myślę że docelowo uda mi się znaleźć obejście ale na razie trzeba o tym pamiętać.
I to tyle jeżeli chodzi o zestawy instalacyjne.
pzdr
-
Oto obiecany skrypt łączący wszystkie instalatory w jedną całość - wersja rozwijana ze względu na wielkość:
<HEAD> <TITLE>Instalatory</TITLE> <HTA:APPLICATION APPLICATIONNAME="Instalatory" ID="Instalatory" BORDER="none" INNERBORDER="no" CAPTION="no" SYSMENU="no" SCROLL="auto" SINGLEINSTANCE="yes" WINDOWSTATE="maximize" SHOWINTASKBAR="no" CONTEXTMENU="no" NAVIGABLE="yes" SELECTION="no"/> <script language="vbscript" type="text/vbscript"> window.resizeTo 800,600 window.focus </script> <style type="text/css"> body {background-image:url('img\winpe.jpg'); background-repeat:no-repeat; background-attachment:fixed; background-position:center; margin:0px; width:0%; height:100%; left:0%; top:0%; padding:0px; overflow:hidden; z-index:0; font-family:Arial; font-size:20px; font-weight:bold;} #TextArea {font-family:Albertus Medium; font-size:20pt; font-weight:bold; text-align:center; position:absolute; overflow:hidden; width:100%; height:100%; Left:0%; vertical-align:middle; Top:25%;} #menu {border-style:none; position:absolute; overflow:auto; top:5%; height:90%; width:90%; left:5%; right:5%; z-index:2;} p {position:relative; text-align:center; z-index:0;} .button {background-image:url('img\background.gif'); position:relative; width:325px; color:#000000; font-family:Arial; font-size:12px; font-weight:bold; border-style:ridge; z-index:2;} .button2 {background-image:url('img\background.gif'); position:relative; width:160px; color:#000000; font-family:Arial; font-size:12px; font-weight:bold; border-style:ridge; z-index:2;} h2 {position:relative; text-align:center; z-index:0;} </style> </HEAD> <script language="vbscript" type="text/vbscript"> dim system_install, objShell, objWMIService, strDrive, strSystem, objFso, strName dim wim_oembios, wim_massstorage, Wim_name, Wim_index, pliki_oem, plik_unattended, default_key dim strdp, straoems, strunattend, rc_oembios, rc_massstorage, rc_name, rc_index Set objShell = CreateObject("WScript.Shell") Set objFso = CreateObject("Scripting.FileSystemObject") dim arrCommands arrCommands = Split(Instalatory.commandLine, "$") If objShell.Environment("Process").Item("SystemDrive") = "X:" Then objShell.Environment("Process").Item("Temp") = "X:\Windows\Temp" objShell.Environment("Process").Item("Tmp") = "X:\Windows\Temp" If Not objFSO.FolderExists("X:\Windows\System32\config\systemprofile\Desktop") Then objFSO.CreateFolder "X:\Windows\System32\config\systemprofile\Desktop" End If End If Sub Window_onLoad DataArea.InnerHTML = "" TextArea.InnerHTML = "" MENU.InnerHTML = "" MenuSystem End Sub Sub MenuSystem Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2") If objFSO.FileExists(arrCommands(1)&"\repozytorium\455asd8.znk") Then Set folder = objfso.GetFolder(arrCommands(1)&"\repozytorium\systemy") Set files = folder.Files For each folderIdx In files Set objFile = objFSO.OpenTextFile(arrCommands(1)&"\repozytorium\systemy\"& folderIdx.Name,1) strName = split(objFile.ReadAll,vbcrlf) strinstalki_repo_conf = strinstalki_repo_conf & "<input class='button' type='button' value='Zainstaluj "&strName(1)&"' onClick='Install_repo_conf ""&strName(1)&"",""&strName(3)&"",""&strName(5)&"",""&strName(7)&"",""&strName(9)&"",""&strName(11)&""'> " objFile.Close Next strmenurpinstall = "<h2>Instalki oparte na repozytorium z konfiguracją</h2>" & strinstalki_repo_conf End If If objFSO.FileExists(arrCommands(1)&"\wim\455asd8.znk") Then Set folder = objfso.GetFolder(arrCommands(1)&"\wim\systemy") Set files = folder.Files For each folderIdx In files Set objFile = objFSO.OpenTextFile(arrCommands(1)&"\wim\systemy\"& folderIdx.Name,1) strName = split(objFile.ReadAll,vbcrlf) strinstalki_WIM = strinstalki_WIM & "<input class='button' type='button' value='Zainstaluj "&strName(1)&"' onClick='Install_WIM ""&strName(1)&"",""&strName(3)&"",""&strName(5)&"",""&strName(7)&"",""&strName(9)&"",""&strName(11)&"",""&strName(13)&"",""&strName(15)&""'> " objFile.Close Next strmenuwiminstall = "<h2>Instalki oparte na pliku WIM</h2>" & strinstalki_WIM End If strmenu1 = "<input class='button2' type='button' value='Notatnik' onClick='ntp'> <input class='button2' type='button' value='Taskmgr' onClick='tskmgr'> <input class='button2' type='button' value='Konsola' onClick='cmd'><br>" strmenu2 = "<input class='button2' type='button' value='Free Commander' onClick='fc'> <input class='button2' type='button' value='Ghost 32' onClick='ghost'> <input class='button2' type='button' value='Opera Portable' onClick='Opera'><br>" strmenu3 = "<input class='button2' type='button' value='Start Sieci' onClick='NET'> <input class='button2' type='button' value='Quit' onClick='wyjscie(1)'> <input class='button2' type='button' value='Restart' onClick='wyjscie(2)'><br>" IF objFSO.FileExists(arrCommands(1)&"\Vista_installer\455asd8.znk") And objFSO.FileExists(arrCommands(1)&"\Seven_Installer\455asd8.znk") Then strmenu4 = "<input class='button' type='button' value='Instalacja systemów Vista lub Server 2008' onClick='Vista_Inst'> <input class='button' type='button' value='Instalacja systemów Seven lub Server 2008 R2' onClick='Seven_Inst'>" strmenuvistainstall = "<h2>Instalki systemów z lini Vista i Seven</h2>" & strmenu4 ElseIf objFSO.FileExists(arrCommands(1)&"\Seven_Installer\455asd8.znk") Then strmenu4 = "<input class='button' type='button' value='Instalacja systemów Seven lub Server 2008 R2' onClick='Seven_Inst'>" strmenuvistainstall = "<h2>Instalki systemów z lini Seven</h2>" & "<p>" & strmenu4 & "</p>" ElseIf objFSO.FileExists(arrCommands(1)&"\Vista_installer\455asd8.znk") Then strmenu4 = "<input class='button' type='button' value='Instalacja systemów Vista lub Server 2008' onClick='Vista_Inst'>" strmenuvistainstall = "<h2>Instalki systemów z lini Vista</h2>" & "<p>" & strmenu4 & "</p>" End If MENU.InnerHTML = "<p>" & strmenurpinstall & "</p>" & "<p>" & strmenuwiminstall & "</p>" & "<p>" & strmenuvistainstall & "</p>" & "<h2>Narzędzia</h2>" & "<p>" & strmenu1 & strmenu2 & strmenu3 & "</p>" End Sub Sub Install_WIM(system,arg_1,arg_2,arg_3,arg_4,arg_5,arg_6,arg_7) Window.resizeTo 800,350 MENU.InnerHTML = "" DataArea.InnerHTML = "" TextArea.InnerHTML = "" On Error Resume Next Set colDisks = objWMIService.ExecQuery("Select * from Win32_LogicalDisk Where (DriveType = 3 OR DriveType = 2) AND DeviceID <> 'A:' AND DeviceID <> 'X:' AND DeviceID <> '" & arrCommands(1) & "'") 'Set colDisks = objWMIService.ExecQuery("Select * from Win32_LogicalDisk Where DriveType = 3 AND DeviceID <> 'x:' AND DeviceID <> '" & arrCommands(1) & "'") For Each objDisk in colDisks strBody4 = strBody4 & "<option value='"& objDisk.DeviceID &"'>"& objDisk.DeviceID &"</option>" Next set colSubfolders = objWMIService.ExecQuery("Associators of {Win32_Directory.Name='"&arrCommands(1)&"\"&arg_3&"'} Where AssocClass = Win32_Subdirectory ResultRole = PartComponent") For Each objFolder in colSubfolders strBody5 = strBody5 & "<option value='"&arrCommands(1)&"\"&arg_3&"\"&objFolder.fileName&"'>"& objFolder.fileName &"</option>" Next Set colSubfolders = objWMIService.ExecQuery("Associators of {Win32_Directory.Name='"&arrCommands(1)&"\"&arg_4&"'} Where AssocClass = Win32_Subdirectory ResultRole = PartComponent") For Each objFolder in colSubfolders strBody6 = strBody6 & "<option value='"&arrCommands(1)&"\"&arg_4&"\"&objFolder.fileName&"'>"& objFolder.fileName &"</option>" Next Set folder = objfso.GetFolder(arrCommands(1)&"\wim\pliki\dp") Set files = folder.Files For each folderIdx In files strBody8 = strBody8 & "<option value='"&folderIdx.Name&"'>"& folderIdx.Name &"</option>" Next str0 = "<option value='null'>null</option>" str1 = "<span style='display:inline width:60px; position:absolute; top:15%; left:5%'><select size='1' name='AvailableDrives'>" str2 = "<input class='button' type='button' value='Potwierdź wybór' onClick='sys_inst_WIM' style='left:25%; top:70%; width:125px;'>" str3 = "<input class='button' type='button' value='Rezygnuję' onClick='Cancel' style='left:45%; top:70%; width:125px;'>" str4 = "<span style='display:inline width:60px; position:absolute; top:22%; left:5%'><select size='1' name='AvailableOEMS'>" str5 = "<span style='display:inline width:60px; position:absolute; top:45%; left:5%'><input type='checkbox' name='chkbox1' checked='True'> Nienadzorowana</span>" str6 = "<span style='display:inline width:60px; position:absolute; top:29%; left:5%'><select size='1' name='AvailableMASS'>" str7 = "<span style='display:inline width:60px; position:absolute; top:55%; left:5%'><input type='checkbox' name='chkbox2'> Użyj katalogu $OEM$</span>" str9 = "<span style='display:inline width:60px; position:absolute; top:65%; left:5%'><input type='checkbox' name='chkbox3'> Autorestart</span>" str8 = "<span style='display:inline width:100px; position:absolute; top:36%; left:5%'><select size='1' name='AvailableDP'>" str10 = "<span style='display:inline width:60px; position:absolute; top:75%; left:5%'><input type='checkbox' name='chkbox4'> Użyj klucza domyślnego</span>" DataArea.InnerHTML = "<h2>Instalacja WIM " & system & "</h2>" & str1 & str0 & strBody4 & "</select>" & " Proszę wybrać partycę docelową</Span>" & str4 & str0 & strBody5 & "</select>" & " Proszę wybrać dostawcę OEM</Span>" & str6 & str0 & strBody6 & "</select>" & " Proszę wybrać Sterowniki MassStorage</Span>" & str5 & str8 & str0 & strBody8 & "</select>" & " Proszę wybrać plik konfiguracji dysku</Span>" & str7 & str9 & str10 & str2 & str3 strSystem = system Wim_name = arg_1 Wim_index = arg_2 wim_oembios = arg_3 wim_massstorage = arg_4 pliki_oem = arg_5 plik_unattended = arg_6 default_key = arg_7 End Sub Sub sys_inst_WIM If AvailableDP.Value <> "null" Then strDrive = "V:" ElseIf AvailableDrives.Value = "null" Then Func_Back_WIM Exit Sub Else strDrive = AvailableDrives.Value End If strMassStorage = AvailableMASS.Value strOEM = AvailableOEMS.Value strDP = AvailableDP.Value if chkbox1.Checked then chkbox1_WIM = "TAK" Set objFile = objFSO.OpenTextFile(arrCommands(1)&"\"&plik_unattended,1,true) strUnAtt = objFile.ReadAll objFile.Close Else if chkbox4.Checked then chkbox4_WIM = "TAK" strdefkey = "[userdata]" & vbCrLf & "productid=" & default_key & vbCrLf & "productkey=" & default_key & vbCrLf end if strUnAtt = "[data]" & vbCrLf & "msdosinitiated=1" & vbCrLf & "floppyless=1" & vbCrLf & "AutoPartition=1" & vbCrLf & "UseSignatures=yes" & vbCrLf & "OriSrc=A:\I386" & vbCrLf & "OriTyp=5" & vbCrLf strnonunat = "[unattended]" & vbCrLf & "OemPreinstall=Yes" &vbCrLf& "DriverSigningPolicy=Ignore" &vbCrLf end If if chkbox2.Checked then chkbox2_WIM = "TAK" end if if chkbox3.Checked then chkbox3_WIM = "TAK" end if DataArea.InnerHTML = "" TextArea.InnerHTML = "" window.resizeTo 768,120 TextArea.InnerHTML = "Proszę czekać,<br>trwa Instalacja " & strSystem If strdp <> "null" Then objShell.run ("%comspec% /c diskpart /s "&chr(34)&arrCommands(1)&"\wim\pliki\DP\"&strDP&chr(34)),0,true Else set colVolumes = objWMIService.ExecQuery("select * from Win32_Volume Where Name = '"&strDrive&"\\'") For Each objVolume in colVolumes objVolume.Format "NTFS",True,,"",False If Not objFSO.FileExists("x:\windows\temp\dp.txt") Then Set objFile = objFSO.CreateTextFile("x:\windows\temp\dp.txt", True) objFile.WriteLine "select volume " & strDrive & vbCrLf & "active" & vbCrLf & "exit" objFile.close End If objShell.Run ("%comspec% /c diskpart /s x:\windows\temp\dp.txt"),0,true objFSO.DeleteFile "x:\windows\temp\dp.txt" Next End If objShell.run ("bootsect.exe /nt52 " & strDrive & " /force /mbr"),0,true objShell.run ("imagex.exe /apply "&arrCommands(1)&"\wim\"&Wim_name&" "&Wim_index&" "&strDrive),0,true Set objFile = objFSO.CreateTextFile(strDrive&"\$WIN_NT$.~BT\winnt.sif",true) objFile.Write strUnAtt & strdefkey objFile.Close 'objShell.run ("wpeutil.exe reboot"),0,false if chkbox2_WIM = "TAK" then objFso.CopyFolder arrCommands(1)&"\"&pliki_oem, strDrive&"\$WIN_NT$.~LS\$OEM$", True end if If strOEM <> "null" Then objFSO.CopyFile strOEM&"\*", strDrive&"\$WIN_NT$.~LS\I386\", True End IF If strMassStorage <> "null" Then Set objFile = objFSO.OpenTextFile(strMassStorage&"\untd.txt",1,true) strMass = objFile.ReadAll objFile.close Set objFile = objFSO.CreateTextFile(strDrive&"\$WIN_NT$.~BT\winnt.sif",true) objFile.Write strUnAtt & strnonunat & strdefkey & strMass objFile.Close If Not objFso.FolderExists(strDrive&"\$WIN_NT$.~LS\$OEM$") Then Set f = objFso.CreateFolder(strDrive&"\$WIN_NT$.~LS\$OEM$") End If Set f = Nothing objFso.CopyFolder strMassStorage&"\txtsetup", strDrive&"\$WIN_NT$.~LS\$OEM$\TEXTMODE", True objFso.CopyFolder strMassStorage&"\txtsetup", strDrive&"\$WIN_NT$.~BT\$OEM$", True End If IF chkbox3_Wim = "TAK" then objShell.Run ("Wpeutil Reboot"),0,false End If window.resizeTo 800,600 MenuSystem DataArea.InnerHTML = "" TextArea.InnerHTML = "" End sub Sub Func_Back_WIM DataArea.InnerHTML = "" TextArea.InnerHTML = "" window.resizeTo 512,120 strbck1 = "<input class='button' type='button' value='Wróć' onClick='Install_WIM ""&strSystem&"",""&Wim_name&"",""&Wim_index&"",""&wim_oembios&"",""&wim_massstorage&"",""&pliki_oem&"",""&plik_unattended&"",""&default_key&""' style='left:5%; top:65%; width:125px;'>" strbck2 = "<input class='button' type='button' value='Diskpart' onClick='diskpart' style='left:10%; top:65%; width:125px;'>" strbck3 = "<input class='button' type='button' value='Rezygnuję' onClick='Cancel' style='left:15%; top:65%; width:125px;'>" TextArea.InnerHTML = "Nie wybrano partycji docelowej" DataArea.InnerHTML = strbck1 & strbck2 & strbck3 End Sub Sub Install_repo_conf(system,arg_1,arg_2,arg_3,arg_4,arg_5) Window.resizeTo 800,350 MENU.InnerHTML = "" DataArea.InnerHTML = "" TextArea.InnerHTML = "" On Error Resume Next Set colDisks = objWMIService.ExecQuery("Select * from Win32_LogicalDisk Where (DriveType = 3 OR DriveType = 2) AND DeviceID <> 'A:' AND DeviceID <> 'X:' AND DeviceID <> '" & arrCommands(1) & "'") For Each objDisk in colDisks strBody4 = strBody4 & "<option value='"& objDisk.DeviceID &"'>"& objDisk.DeviceID &"</option>" Next set colSubfolders = objWMIService.ExecQuery("Associators of {Win32_Directory.Name='"&arrCommands(1)&"\"&arg_2&"'} Where AssocClass = Win32_Subdirectory ResultRole = PartComponent") For Each objFolder in colSubfolders strBody5 = strBody5 & "<option value='"&arrCommands(1)&"\"&arg_2&"\"&objFolder.fileName&"'>"& objFolder.fileName &"</option>" Next Set colSubfolders = objWMIService.ExecQuery("Associators of {Win32_Directory.Name='"&arrCommands(1)&"\"&arg_3&"'} Where AssocClass = Win32_Subdirectory ResultRole = PartComponent") For Each objFolder in colSubfolders strBody6 = strBody6 & "<option value='"&arrCommands(1)&"\"&arg_3&"\"&objFolder.fileName&"'>"& objFolder.fileName &"</option>" Next Set folder = objfso.GetFolder(arrCommands(1)&"\repozytorium\pliki\dp") Set files = folder.Files For each folderIdx In files strBody8 = strBody8 & "<option value='"&folderIdx.Name&"'>"& folderIdx.Name &"</option>" Next str0 = "<option value='null'>null</option>" str1 = "<span style='display:inline width:60px; position:absolute; top:15%; left:5%'><select size='1' name='AvailableDrives'>" str2 = "<input class='button' type='button' value='Potwierdź wybór' onClick='sys_inst_repo_conf' style='left:25%; top:60%; width:125px;'>" str3 = "<input class='button' type='button' value='Rezygnuję' onClick='Cancel' style='left:45%; top:60%; width:125px;'>" str4 = "<span style='display:inline width:60px; position:absolute; top:22%; left:5%'><select size='1' name='AvailableOEMS'>" str5 = "<span style='display:inline width:60px; position:absolute; top:45%; left:5%'><input type='checkbox' name='chkbox1' checked='True'> Nienadzorowana</span>" str6 = "<span style='display:inline width:60px; position:absolute; top:29%; left:5%'><select size='1' name='AvailableMASS'>" str7 = "<span style='display:inline width:60px; position:absolute; top:55%; left:5%'><input type='checkbox' name='chkbox2'> Użyj katalogu $OEM$</span>" str9 = "<span style='display:inline width:60px; position:absolute; top:65%; left:5%'><input type='checkbox' name='chkbox3'> Autorestart</span>" str8 = "<span style='display:inline width:100px; position:absolute; top:36%; left:5%'><select size='1' name='AvailableDP'>" DataArea.InnerHTML = "<h2>Instalacja repozytorium z konfiguracją " & system & "</h2>" & str1 & str0 & strBody4 & "</select>" & " Proszę wybrać partycę docelową</Span>" & str4 & str0 & strBody5 & "</select>" & " Proszę wybrać dostawcę OEM</Span>" & str6 & str0 & strBody6 & "</select>" & " Proszę wybrać Sterowniki MassStorage</Span>" & str5 & str8 & str0 & strBody8 & "</select>" & " Proszę wybrać plik konfiguracji dysku</Span>" & str7 & str9 & str10 & str2 & str3 strSystem = system rc_name = arg_1 rc_oembios = arg_2 rc_massstorage = arg_3 pliki_oem = arg_4 plik_unattended = arg_5 End Sub Sub sys_inst_repo_conf If AvailableDP.Value <> "null" Then strDrive = "V:" ElseIf AvailableDrives.Value = "null" Then Func_Back_repo_conf Exit Sub Else strDrive = AvailableDrives.Value End If strMassStorage = AvailableMASS.Value strOEM = AvailableOEMS.Value strDP = AvailableDP.Value if chkbox1.Checked then chkbox1_rc = "TAK" strunattended = " /unattend:" & arrCommands(1)&"\"&plik_unattended Set objFile = objFSO.OpenTextFile(arrCommands(1)&"\"&plik_unattended,1,true) strUnAtt = objFile.ReadAll objFile.Close Else strnonunat = "[unattended]" & vbCrLf & "OemPreinstall=Yes" &vbCrLf& "DriverSigningPolicy=Ignore" &vbCrLf end If if chkbox2.Checked then chkbox2_rc = "TAK" end if if chkbox3.Checked then chkbox3_rc = "TAK" end if DataArea.InnerHTML = "" TextArea.InnerHTML = "" window.resizeTo 768,120 TextArea.InnerHTML = "Proszę czekać,<br>trwa Instalacja " & strSystem If strdp <> "null" Then objShell.run ("%comspec% /c diskpart /s "&chr(34)&arrCommands(1)&"\repozytorium\pliki\DP\"&strDP&chr(34)),0,true Else set colVolumes = objWMIService.ExecQuery("select * from Win32_Volume Where Name = '"&strDrive&"\\'") For Each objVolume in colVolumes objVolume.Format "NTFS",True,,"",False If Not objFSO.FileExists("x:\windows\temp\dp.txt") Then Set objFile = objFSO.CreateTextFile("x:\windows\temp\dp.txt", True) objFile.WriteLine "select volume " & strDrive & vbCrLf & "active" & vbCrLf & "exit" objFile.close End If objShell.Run ("%comspec% /c diskpart /s x:\windows\temp\dp.txt"),0,true objFSO.DeleteFile "x:\windows\temp\dp.txt" Next End If objShell.run ("bootsect.exe /nt52 " & strDrive & " /force /mbr"),0,true objShell.run (arrCommands(1) & "\repozytorium\instalatory\"&rc_name&"\i386\winnt32.exe /makelocalsource /noreboot /syspart:" & strDrive & " /tempdrive:" & strDrive &strunattended),0,true if chkbox2_rc = "TAK" then objFso.CopyFolder arrCommands(1)&"\"&pliki_oem, strDrive&"\$WIN_NT$.~LS\$OEM$", True end if If strOEM <> "null" Then objFSO.CopyFile strOEM&"\*", strDrive&"\$WIN_NT$.~LS\I386\", True End IF If strMassStorage <> "null" Then Set objFile = objFSO.OpenTextFile(strDrive&"\$WIN_NT$.~BT\winnt.sif",1,true) strUnAtt = objFile.ReadAll objFile.Close Set objFile = objFSO.OpenTextFile(strMassStorage&"\untd.txt",1,true) strMass = objFile.ReadAll objFile.close Set objFile = objFSO.CreateTextFile(strDrive&"\$WIN_NT$.~BT\winnt.sif",true) objFile.Write strUnAtt & strnonunat & strMass objFile.Close If Not objFso.FolderExists(strDrive&"\$WIN_NT$.~LS\$OEM$") Then Set f = objFso.CreateFolder(strDrive&"\$WIN_NT$.~LS\$OEM$") End If Set f = Nothing objFso.CopyFolder strMassStorage&"\txtsetup", strDrive&"\$WIN_NT$.~LS\$OEM$\TEXTMODE", True objFso.CopyFolder strMassStorage&"\txtsetup", strDrive&"\$WIN_NT$.~BT\$OEM$", True End If IF chkbox3_rc = "TAK" then objShell.Run ("Wpeutil Reboot"),0,false End If window.resizeTo 800,600 MenuSystem DataArea.InnerHTML = "" TextArea.InnerHTML = "" End sub Sub Func_Back_repo_conf DataArea.InnerHTML = "" TextArea.InnerHTML = "" window.resizeTo 512,120 strbck1 = "<input class='button' type='button' value='Wróć' onClick='install_repo_conf ""&strSystem&"",""&rc_name&"",""&rc_oembios&"",""&rc_massstorage&"",""&pliki_oem&"",""&plik_unattended&""' style='left:5%; top:65%; width:125px;'>" strbck2 = "<input class='button' type='button' value='Diskpart' onClick='diskpart' style='left:10%; top:65%; width:125px;'>" strbck3 = "<input class='button' type='button' value='Rezygnuję' onClick='Cancel' style='left:15%; top:65%; width:125px;'>" TextArea.InnerHTML = "Nie wybrano partycji docelowej" DataArea.InnerHTML = strbck1 & strbck2 & strbck3 End Sub Sub Vista_Inst Window.resizeTo 750,250 MENU.InnerHTML = "" DataArea.InnerHTML = "" TextArea.InnerHTML = "" On Error Resume Next Set folder = objfso.GetFolder(arrCommands(1)&"\vista_Installer\vista_unattend") Set files = folder.Files For each folderIdx In files strBody42 = strBody42 & "<option value='"&folderIdx.Name&"'>"& folderIdx.Name &"</option>" Next Set colSubfolders = objWMIService.ExecQuery("Associators of {Win32_Directory.Name='"&arrCommands(1)&"\vista_Installer\vista_unattend\AOems'} Where AssocClass = Win32_Subdirectory ResultRole = PartComponent") For Each objFolder in colSubfolders strBody45 = strBody45 & "<option value='"&objFolder.Name&"'>"& objFolder.fileName &"</option>" Next Set folder = objfso.GetFolder(arrCommands(1)&"\vista_Installer\vista_unattend\dp") Set files = folder.Files For each folderIdx In files strBody48 = strBody48 & "<option value='"&folderIdx.Name&"'>"& folderIdx.Name &"</option>" Next str40 = "<option value='null'>null</option>" str41 = "<span style='display:inline width:60px; position:absolute; top:15%; left:5%'><select size='1' name='AvailableUnattend'>" str43 = "<input class='button' type='button' value='Potwierdź wybór' onClick='Vista_Instal' style='left:25%; top:50%; width:125px;'>" str44 = "<input class='button' type='button' value='Rezygnuję' onClick='Cancel' style='left:35%; top:50%; width:125px;'>" str46 = "<span style='display:inline width:80px; position:absolute; top:30%; left:5%'><select size='1' name='AvailableAOems'>" str47 = "<span style='display:inline width:60px; position:absolute; top:60%; left:5%'><input type='checkbox' name='chkbox1'> Autorestart</span>" str48 = "<span style='display:inline width:100px; position:absolute; top:45%; left:5%'><select size='1' name='AvailableDP'>" DataArea.InnerHTML = "<h2>Instalacja Systemu Vista lub Server 2008</h2>" & str41 & str40 & strBody42 & "</select>" & " Proszę wybrać plik instalacji nienadzorowanej</Span>" & str46 & str40 & strBody45 & "</select>" & " Proszę wybrać Alternatywny katalog $OEM$</Span>" & str48 & str40 & strBody48 & "</select>" & " Proszę wybrać skrypt przygotowujący dysk</Span>" & str47 & str43 & str44 End Sub Sub Vista_Instal strunattend = AvailableUnattend.Value straoems = AvailableAOems.Value strdp = AvailableDP.Value if chkbox1.Checked then chkbox1_Vista = "TAK" end if MENU.InnerHTML = "" DataArea.InnerHTML = "" TextArea.InnerHTML = "" window.resizeTo 725,160 TextArea.InnerHTML = "Instalacja systemów z lini Vista<br>Windows Vista, Serwer 2008" If strdp <> "null" Then objShell.run ("%comspec% /c" & "diskpart /s "&chr(34)&arrCommands(1)&"\vista_Installer\vista_unattend\DP\"&strDP&chr(34)),0,true End If If strunattend = "null" AND straoems = "null" Then objShell.run (arrCommands(1) & "\vista_Installer\setup.exe /noreboot"),0,true ElseIF strunattend <> "null" AND straoems = "null" Then objShell.run (arrCommands(1) & "\vista_Installer\setup.exe /noreboot /unattend:"&arrCommands(1)&"\vista_Installer\vista_unattend\"&strunattend),0,true ElseIF strunattend = "null" AND straoems <> "null" Then objShell.run (arrCommands(1) & "\vista_Installer\setup.exe /noreboot /m:"&straoems),0,true Else objShell.run (arrCommands(1) & "\vista_Installer\setup.exe /noreboot /m:"&straoems&" /unattend:"&arrCommands(1)&"\vista_Installer\vista_unattend\"&strunattend),0,true End If IF chkbox1_Vista = "TAK" then self.close() End If window.resizeTo 1024,768 MenuSystem TextArea.InnerHTML = "" End Sub Sub Seven_Inst Window.resizeTo 750,250 MENU.InnerHTML = "" DataArea.InnerHTML = "" TextArea.InnerHTML = "" On Error Resume Next Set folder = objfso.GetFolder(arrCommands(1)&"\seven_Installer\seven_unattend") Set files = folder.Files For each folderIdx In files strBody22 = strBody22 & "<option value='"&folderIdx.Name&"'>"& folderIdx.Name &"</option>" Next Set colSubfolders = objWMIService.ExecQuery("Associators of {Win32_Directory.Name='"&arrCommands(1)&"\seven_Installer\seven_unattend\AOems'} Where AssocClass = Win32_Subdirectory ResultRole = PartComponent") For Each objFolder in colSubfolders strBody25 = strBody25 & "<option value='"&objFolder.Name&"'>"& objFolder.FileName &"</option>" Next Set folder = objfso.GetFolder(arrCommands(1)&"\seven_Installer\seven_unattend\dp") Set files = folder.Files For each folderIdx In files strBody28 = strBody28 & "<option value='"&folderIdx.Name&"'>"& folderIdx.Name &"</option>" Next str20 = "<option value='null'>null</option>" str21 = "<span style='display:inline width:60px; position:absolute; top:15%; left:5%'><select size='1' name='AvailableUnattend'>" str23 = "<input class='button' type='button' value='Potwierdź wybór' onClick='Seven_Instal' style='left:25%; top:50%; width:125px;'>" str24 = "<input class='button' type='button' value='Rezygnuję' onClick='Cancel' style='left:35%; top:50%; width:125px;'>" str26 = "<span style='display:inline width:80px; position:absolute; top:30%; left:5%'><select size='1' name='AvailableAOems'>" str27 = "<span style='display:inline width:60px; position:absolute; top:60%; left:5%'><input type='checkbox' name='chkbox1'> Autorestart</span>" str28 = "<span style='display:inline width:100px; position:absolute; top:45%; left:5%'><select size='1' name='AvailableDP'>" DataArea.InnerHTML = "<h2>Instalacja Systemu z lini Seven</h2>" & str21 & str20 & strBody22 & "</select>" & " Proszę wybrać plik instalacji nienadzorowanej</Span>" & str26 & str20 & strBody25 & "</select>" & " Proszę wybrać Alternatywny katalog $OEM$</Span>" & str28 & str20 & strBody28 & "</select>" & " Proszę wybrać skrypt przygotowujący dysk</Span>" & str27 & str23 & str24 End Sub Sub Seven_Instal strunattend = AvailableUnattend.Value straoems = AvailableAOems.Value strdp = AvailableDP.Value if chkbox1.Checked then chkbox1_Seven = "TAK" end if MENU.InnerHTML = "" DataArea.InnerHTML = "" TextArea.InnerHTML = "" window.resizeTo 725,160 TextArea.InnerHTML = "Instalacja systemów z lini Seven<br>Windows Seven, Serwer 2008 R2" If strdp <> "null" Then objShell.run ("%comspec% /c" & "diskpart /s "&chr(34)&arrCommands(1)&"\seven_Installer\seven_unattend\DP\"&strDP&chr(34)),0,true End If If strunattend = "null" AND straoems = "null" Then objShell.run (arrCommands(1) & "\seven_Installer\setup.exe /noreboot"),0,true ElseIF strunattend <> "null" AND straoems = "null" Then objShell.run (arrCommands(1) & "\seven_Installer\setup.exe /noreboot /unattend:"&arrCommands(1)&"\seven_Installer\seven_unattend\"&strunattend),0,true ElseIF strunattend = "null" AND straoems <> "null" Then objShell.run (arrCommands(1) & "\seven_Installer\setup.exe /noreboot /m:"&straoems),0,true Else objShell.run (arrCommands(1) & "\seven_Installer\setup.exe /noreboot /m:"&straoems&" /unattend:"&arrCommands(1)&"\seven_Installer\seven_unattend\"&strunattend),0,true End If IF chkbox1_Seven = "TAK" then self.close() End If window.resizeTo 1024,768 MenuSystem TextArea.InnerHTML = "" End Sub sub cancel DataArea.InnerHTML = "" TextArea.InnerHTML = "" window.resizeTo 800,600 MenuSystem end sub Sub ghost MENU.InnerHTML = "" window.resizeTo 512,80 TextArea.InnerHTML = "Uruchomiono Ghost 32" objShell.Run (arrCommands(1) & "\tools\ghost32.exe -prefos"),0,True window.resizeTo 800,600 MenuSystem TextArea.InnerHTML = "" End Sub Sub ntp MENU.InnerHTML = "" window.resizeTo 512,80 TextArea.InnerHTML = "Uruchomiono Notatnik" objShell.Run ("notepad"),1,True window.resizeTo 800,600 MenuSystem TextArea.InnerHTML = "" End Sub Sub cmd MENU.InnerHTML = "" window.resizeTo 512,80 TextArea.InnerHTML = "Uruchomiono Wiersz Poleceń" objShell.Run ("%comspec%"),1,True window.resizeTo 800,600 MenuSystem TextArea.InnerHTML = "" End Sub Sub NET MENU.InnerHTML = "" window.resizeTo 512,80 TextArea.InnerHTML = "Startuje sieć" objShell.Run ("wpeutil InitializeNetwork"),0,True objShell.Run ("wpeutil DisableFirewall"),0,True window.resizeTo 800,600 MenuSystem TextArea.InnerHTML = "" End Sub Sub FC MENU.InnerHTML = "" window.resizeTo 512,80 TextArea.InnerHTML = "Uruchomiono FreeCommandera" objShell.Run (arrCommands(1) & "\tools\FreeCommanderPortable\FreeCommanderPortable.exe"),0,True window.resizeTo 800,600 MenuSystem TextArea.InnerHTML = "" End Sub Sub Opera MENU.InnerHTML = "" window.resizeTo 512,80 TextArea.InnerHTML = "Uruchomiono Operę" objShell.Run (arrCommands(1) & "\tools\OperaPortable\OperaPortable.exe"),0,True window.resizeTo 800,600 MenuSystem TextArea.InnerHTML = "" End Sub Sub tskmgr MENU.InnerHTML = "" window.resizeTo 512,80 TextArea.InnerHTML = "Uruchomiono Menedżer zadań" objShell.Run ("taskmgr"),1,True window.resizeTo 800,600 MenuSystem TextArea.InnerHTML = "" End Sub sub wyjscie(str_str) If str_str = 1 Then self.close() ElseIf str_str = 2 Then objShell.Run ("Wpeutil Reboot"),0,false End If end sub </script> <body id=body> <span id=menu></span> <span id=DataArea></span> <span id=TextArea></span>
I jak zwykle linki zewnętrzne:
Skrypt posiada funkcjonalność wszystkich trzech wcześniej opisanych zestawów, dodatkowo menu zostało lekko przearanżowane głównie dla oszczędności miejsca ale też ze względów estetycznych.
Dodatkowo (co wcześniej zapowiedziałem) skrypt posiada funkcjonalność włączania poszczególnych sekcji w ramach potrzeby, aby dana sekcja pojawiła się w GUI przynależny jej katalog musi zawierać ten sam znacznik który znajduje się w katalogu boot, jeżeli katalog nie istnieje lub nie zawiera rzeczonego pliku "455asd8.znk" nie zostanie wyrenderowany odpowiadający jej fragment.
Znacznik opcjonalnie jest szukany w następujących katalogach: "wim", "repozytorium", "Seven_Installer", "Vista_installer".
Jak widać również w przypadku visty i siódemki można jeden z batonów (bądź oba) pozostawić niewłączone.
A tak wygląda GUI Menu w całej okazałości:
ps
w przypadku sekcji dotyczącej narzędzi zostawiłem ją włączoną ale myślę, że zainteresowane osoby bez problemu znajdą sposób na jej ewentualne wyłączenie - tak naprawdę tą sekcję i tak należałoby zdefiniować wg własnych potrzeb, być może w przyszłości również dla niej zbuduję jakiś automat generujący wg prostych plików konfiguracyjnych (typu nazwa w menu, nazwa i ścieżka do pliku exe).
I to tyle, wydaje mi się, że wyczerpałem temat choć dopuszczam zmiany i poprawki. Ponownie zapraszam do dyskusji.
Postaram się też wrzucić WinPE z szablonem katalogów dostosowanych do tego konkretnego menu.
pzdr
Instalacja systemów z pendriva
w Platformy klienckie Microsoftu
Opublikowano
ad.1
Można oczywiście ustawić domyślny fokus na volumen c: ale psuje to trochę logikę zestawu.
Wolumen C: będzie pierwszą partycją na pierwszym dysku pod warunkiem, że będzie to partycja rozpoznawalna przez system, jeżeli pracujemy z dyskiem czystym bądź z konfiguracją w której dopiero stworzymy interesującą nas partycję w ramach dostępnego wolnego obszaru to nie będzie to prawdą bo C: jest już przypisane, oczywiście można wtedy dokonać wyboru, kwestia jaka sytuacja jest częstsza, dla mnie akurat częściej występuje sytuacja w której c: odpowiada napędowi DVD, ustawianie czegokolwiek psuje wewnętrzne procedury sprawdzające które pilnują wyboru partycji z jednej strony a z drugiej filtrują wszystko co nie jest dyskiem typu fixed, są konfiguracje (to zależy od komputera), że pod c: może wylądować czytnik kart czy nawet ten pen z którego botujemy.
Zestaw został zbudowany jako narzędzie jak najbardziej uniwersalne dlatego ten zamysł troszeczkę nie pasuje, oczywiście na potrzeby stosowania go z jedną maszyną (choć jest to trochę jak strzelanie z armaty do komara) można sobie takie uproszczenie zastosować, można też wymusić instalację na konkretnej partycji wg kolejności w biosie z zupełnym pominięciem wyboru przypisanej ścieżki (np. instalujemy zawsze na pierwszej partycji dysku oznaczonego jako zero).
ad.2
Trudno mi zgadnąć cóż to za ustrojstwo, mogę obstawiać jedynie jakiś czytnik kart, ewentualnie volumen wirtualny (niektóre modemy na usb np. tworzą coś takiego celem instalacji sterowników), zakładając oczywiście że nie jest to twór twojego autorstwa. Pokaż jakieś logi i/lub screeny może się coś wyjaśni. Zestaw w każdym bądź razie nic takiego nie prokuruje.
pzdr