Jump to content

idle.newbie

Member
  • Posts

    93
  • Joined

  • Last visited

  • Donations

    0.00 USD 
  • Country

    Taiwan

Posts posted by idle.newbie

  1. according to DeployTools.cab\ref.chm\Unattend.txt\[GuiRunOnce]

    Commands called in the [GuiRunOnce]section process synchronously. Each application runs in the order listed in this section, and each command must finish before you run the next command.
    it waits until program finished.

    got Word/Excel Viewer 2003 etc. in my disc, RunOnceEx injected @T-12, they always install one by one.

    maybe that's caused by your wrapping program WAIT.exe, which forks another process to do app install. e.g. when i do "nircmd.exe exec hide app.exe", nircmd.exe forks a new process to run app.exe, the app.exe still running, but nircmd.exe's task is over so it terminate itself.

    anyway, tho your script works, just don't care the 1k less script copied to hd, or kill itself after WAIT.exe terminated(DEL /F /Q %~f0).

  2. if GuiRunOnce accepts program/arguments, this should work. only tried in command prompt in working system, never tried on CD.

    [GuiRunOnce]
    %SystemRoot%\system32\cmd.exe /Q /C FOR /F %I IN ('%SystemRoot%\system32\findstr.exe dospath= %SystemRoot%\system32\$WINNT$.INF') DO (FOR %J IN (%I$OEM$) DO (IF EXIST %J (%~dJ\Install\Install.cmd)))

    IMHO, GuiRunOnce == RunOnceEx injeted from CMDLINES.txt, dunno why you don't do that there.

  3. -= However, DO NOT use spaces on a MultiBoot Disc - it won't work.
    it only restrict spaces on SourcePath, anything elses under sourcepath are free.

    CD:\XP Pro\i386\... will not work. replace space with _ underscore or - dash.

    CD:\XP-Pro_A\i386\... no problem.

    CD:\XP-Pro_A\$OEM$\Drivers\nVidia ForceWare 77.72\... no problem

    anything using similar DetachedProgram/Arguments to get sourcepath from $winnt$.inf got this problem. no workaround yet. but this method did retrive correct sourcepath on multiboot cd from reliable source, on cd base installation.

    edit:

    nvm

  4. @hp38user:

    the process/thread stuff you said in this page, that's what i thought, but i'm too poor to explain in English. :(

    this ticker scripts' kinda hard coded time slicing.

    i use NirCmd cmdwait first place, but it pops all immediately, as you said there's something wrong with some timer function. so i back to wait.

    freeze is not cause by SetupCopyOEMInf nor setup.exe, only they deadlocked in some place in setupapi.dll.

    that's my guess, may be wrong. needs some experts' idea.

    @a06lp:

    passed another test with huge sets of BtS driver pack Chipset+GraphicsA+Lan+SoundAB(extracted size about 680Mb in HD).

    use NirCmd.exe exec hide Drivers.cmd in Arguments block if the script works. hides everything from poping up, save some cpu to repaint cmd window.

    edit:

    only test with disc made last year, done in command prompt by hand, scripts and BtS DP extraction. dunno what will happen when they're on cd.

    you should also note that DO NOT use sourcePath with spaces when people make multiboot disc, can't handle it, Arguments did not allow quotes inside. use regular wording A-Za-z0-9_-..

    +--XP Pro

    ¦.....+--$OEM$

    ¦.........+--Drivers

    ¦.............+---blah.blah

    ¦.....+--i386

    ¦.............+---winnt.sif

    +--XPHome

    ¦.....+--$OEM$

    ¦.........+--Drivers

    ¦.............+---blah.blah

    ¦.....+--i386

    ¦.........+--winnt.sif

    red=not allow, green=okay
  5. they're the same for setPriority, only it's in batch.

    i added another ticker script which loops until SetupCopyOEMInf ends. 10sec to run setup.exe, 50sec to suspend it, loops.

    SetupCopyOEMInf freeze when setup.exe suspended, i guess that's because they need to update something with setupapi.dll. the ticker script gives setup.exe 10sec within 1min to update, so they won't interlocked and setup.exe uses lesser cpu(1/6).

    10 : 50 that's for my laptop. besides, setup.exe=low, SetupCopyOEMInf.exe=high. i had bad experience with resume time less than 10sec.

  6. pausep>%SystemDrive%\pid.txt
    FOR /F "tokens=2" %%I IN ('findstr /I /L "setup.exe" %SystemDrive%\pid.txt) DO DEL %SystemDrive%\pid.txt & SET Setup_PID=%%I

    redirect to a temp file and parse from it.

    imho pausep=psSuspend :(

    edit:

    redo another install, same as psSuspend.

    SetupCopyOEMInf slows down and stopped at some driver, after Ctrl-C SetupCopyOEMInf, and rescan again, it passed. same as i use psSuspend.

    edit2:

    @a06lp:

    my lastest test, using NirCmd to detach another ticker script that resume-wait10sec-suspend-wait50sec-resume setup.exe, it works on my laptop with 63 driver paths. the modem driver which cause SetupCopyOEMInf stopped when setup.exe totally suspended, and it passed on resume-suspend-resume method.

    combine this method and setPriority, SetupCopyOEMInf gets more cpu without interlocked.

    to lower setup.exe's priority for batch guys, googled a freeware called Process.exe, it can Suspend/Resume/Kill/SetPriority/List processes in size 53,248 bytes/26,112 bytes(upx -9). use this program instead of psSuspend/psKill/psList myself.

    NirCmd Freeware command-line tool, 47,104 bytes/25,088 bytes(upx -9). lots free utils at this site. use NirCmd to setting mixer/inetdial/shortcuts/etc myself. tried NirCmd's new command "cmdwait", it's not working @T-39.

    @ECHO OFF

    CD /D "%~dp0"

    ::REM Ticker script

    ECHO.exec hide %CD%\Process.exe -r setup.exe >%SystemDrive%\Ticker.ncl

    ECHO.wait 10000 >>%SystemDrive%\Ticker.ncl

    ECHO.exec hide %CD%\Process.exe -p SetupCopyOEMInf.exe high >>%SystemDrive%\Ticker.ncl

    ECHO.exec hide %CD%\Process.exe -s setup.exe >>%SystemDrive%\Ticker.ncl

    ECHO.wait 50000 >>%SystemDrive%\Ticker.ncl

    ECHO.script %SystemDrive%\Ticker.ncl >>%SystemDrive%\Ticker.ncl

    ::REM Suspend/Low setup.exe

    .\Process.exe -s setup.exe

    .\Process.exe -p setup.exe low

    ::REM OemPreinstall=No

    IF EXIST $1.7z .\7za.exe x -y -aoa -o"%SystemDrive%\" ".\$1.7z"

    IF EXIST $$.7z .\7za.exe x -y -aoa -o"%SystemRoot%" ".\$$.7z"

    ::REM DriversOnCD

    START .\WatchDriverSigningPolicy.exe

    SET DRV=DRV

    ::REM Drivers7z2HD

    IF EXIST DRV.7z (

    SET DRV=%SystemDrive%\DRV

    .\7za.exe x -y -aoa -o"%SystemDrive%\DRV" ".\DRV.7z"

    )

    ::REM NirCmd ticker

    START .\NirCmd.exe script %SystemDrive%\Ticker.ncl

    .\SetupCopyOEMInf.exe "%DRV%"

    ::REM PostInstall

    .\Process.exe -k NirCmd.exe

    .\Process.exe -p setup.exe normal

    .\Process.exe -r setup.exe

    DEL %SystemDrive%\Ticker.ncl

    EXIT

    green=optional, red=customize

    add NirCmd.exe exec hide before script name in WINNT.SIF, hides pop-up cmd window.

  7. can u use batch while installing windows?

    i tried to creat a batch file at $oem$

    and creat a driver.cmd

    and make a CMDLINES.TXT

    and remove the entries

    (IN WINNT.SIF)

    but it won't install any driver for me... just testing....

    if you wanna try batch way, remove Drivers.cmd in CMDLINES.TXT, and keep the [GuiUnattended] part:

    [GuiUnattended]DetachedProgram = ".\system32\cmd.exe"

    Arguments="/Q /C FOR /F %I IN (%SystemRoot%\system32\$winnt$.inf) DO (FOR %J IN (%I$OEM$) DO (IF EXIST %J (START /MIN /D%J Drivers.cmd)))"

    got no CDR now, but when i insert my old disc(using DetachedProgram with batch @T-39). i've done following tests:

    when setup.exe starts, press Shift-F10 to open command prompt, and enter "PsSuspend setup.exe" when DetachedProgram starts. the setup.exe totally frozen(even no repaint). i didn't put drivers on cd, compressed drivers instead, the 7z extracting console works fine as usual. the setup.exe stopped until "PsSuspend -r setup.exe"(30min at least, out for something).

    tho i didn't execute any WatchDriverSigningPolicy/SetupCopyOEMInf, do that using OemPnPDriversPath(my driver lists' short), the issue using DetachedProgram to install pnp drivers is time exceeded T-34.

    the setup.exe freeze, drivers extracting smoothly, nothing geek to me. it seems okay using PsSuspend in DetachedProgram with batch.

    ps. full SP2 source image last year without nLited, no hotfixs, nothing patched.

  8. http://www.msfn.org/board/index.php?showtopic=51406

    [Unattended]
    OemPreinstall = No
    [GuiUnattended]
    DetachedProgram = ".\system32\cmd.exe"
    Arguments="/Q /C FOR /F %I IN (%SystemRoot%\SYSTEM32\$WINNT$.INF) DO (FOR %J IN (%I$OEM$) DO (IF EXIST %J (START /MIN /D%J Detached.cmd)))"

    modify the "Detached.cmd" into ur useraccounts.cmd or else. it works on WINNT.SIF OemPreinstall=No or Yes.

    and do whatever you need in ur batch, xcopy, or extracting. there's some restriction at T-39, see Pyron's pinned thread.

    i compressed everything into 7z, like $$.7z, $1.7z, put them on $OEM$, then extract in Detached.cmd.

    @ECHO
    .\7za.exe x -y -aoa -o"%SystemDrive%" ".\$1.7z"
    .\7za.exe x -y -aoa -o"%SystemRoot%" ".\$$.7z"
    ::REM == XCOPY $1 "%SystemDrive%" /E /V /Y
    ::REM == XCOPY $$ "%SystemRoot%" /E /V /Y

  9. @sonic:

    you don't need WatchDriverSigningPolicy.exe for WHQL drivers.

    @hp38quser:

    i love sysinternals & nircmd :blushing:

    seems PsSuspend fix the driver extraction before T-34 limitation, got my perfect method. :D

    you should keep WatchDriverSigningPolicy.exe(for non WHQL) until driver scan finished, T-13 will be a good place to PsKill it. @T-39 REG ADD HKLM\....\RunOnceEx to PsKill or CMDLINES.TXT. and turn back Pyron's postinstall. or do that @WINNT.SIF [GuiRunOnce], if my broken memory still ok it's about T-9?

    anyone knows if SetupCopyOEMInf.exe accepts more than one paths?

    Detached.cmd for DriverOnCD or Driver7z2HD:

    @ECHO OFF
    .\PsSuspend.exe setup.exe
    .\WatchDriverSigningPolicy.exe
    IF EXIST Drivers.7z DO (
    ::REM extracting drivers archiver to hd, optional
    .\7za.exe x -y -aoa -o"%SystemDrive%\Drivers" ".\Drivers.7z"
    .\SetupCopyOEMInf.exe "%SystemDrive%\Drivers"
    ) ELSE (
    .\SetupCopyOEMInf.exe Drivers
    )
    .\PsSuspend.exe -r setup.exe
    ::REM PsKill WatchDriverSigningPolicy
    REG ADD "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEx" /V "zzzPsKillWatchDriverSigningPolicy" /D "%CD%\PsKill.exe -t WatchDriverSign"
    ::REM PostInstall
    REG ADD "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEx" /V "zzzzPostInstall" /D "regedit /s %CD%\postInstall.reg"
    EXIT

    WatchDriverSigningPolicy.exe, SetupCopyOEMInf.exe, PsSuspend.exe, PsKill.exe, postInstall.reg(Pyron's DevicePath/DriverSigning regTweak), 7za.exe(optional), Drivers.7z(optional) in $OEM$ directory.

    those psKill and postInstall stuff can put in #1 HKLM\...\RunOnceEx(maybe RunOnce, can't sure), #2 CMDLINES.TXT, #3 WINNT.SIF [GuiRunOnce].

    edit:

    process name for psKill to kill seems only 15 chars in length at w2k box, psKill "WatchDriverSign".

  10. free sysinternals' PsSuspend included inside PsTools? http://www.sysinternals.com/Utilities/PsSuspend.html

    Arguments="/Q /C FOR /F %I IN (%SystemRoot%\SYSTEM32\$WINNT$.INF) DO (FOR %J IN (%I$OEM$) DO (IF EXIST %J (start /min /D%J Autoit3.exe Drivers.au3)))"

    using DetachedProgram to scan dospath should consider a hack, tho it works currently, it may not perm.

    i love Pryon's SetupCopyOEMInf.exe :D

    maybe i should modify my Detached.cmd with PsTools into:

    @ECHO OFF
    .\PsSuspend.exe setup.exe
    .\WatchDriverSigningPolicy.exe
    ::rem extracting drivers archiver to hd, optional
    ::rem .\7za.exe x -y -o"%SystemDrive%\Drivers" ".\Drivers.7z"
    .\SetupCopyOEMInf.exe Drivers
    .\PsSuspend.exe -r setup.exe

    save another 118,272(AutoIt3.exe) - 31,232(upx -9 PsSuspend.exe) = 87,040 bytes :D

    WatchDriverSigningPolicy.exe should PsKill after T-13?

    if SetupCopyOEMInf.exe accepts more paths, then i'll change to SetupCopyOEMInf.exe Drivers "%SystemDrive%\Drivers", fits on both [drivers on cd] and [drivers extract to hd].

  11. @MtK

    fso.deleteFile(WScript.ScriptFullName, true);

    try force delete Read-Only file...

    the kill-itself script was tricky, share-violation should happen, but every time i ran the script, it had no problem with that. i can't give you a firm answer or solution, but this tricky script do it's job for me all the time.

  12. or RegExp way.

    output your pre-configured mailRules into $OEM$\$1\preMade.reg, and save the following script into $OEM$\$Docs\Default User\Start Menu\Programs\Startup\OE_Rules.js

    var wsh = WScript.CreateObject("WScript.Shell");
    var fso = WScript.CreateObject("Scripting.FileSystemObject");

    var fileName = wsh.ExpandEnvironmentStrings('%SystemDrive%\\preMade.reg');

    var ForReading = 1, ForWriting = 2, ForAppending = 8;
    var TristateUseDefault = -2, TristateTrue = -1, TristateFalse = 0;
    var f = fso.openTextFile(fileName, ForReading, false, TristateTrue);
    var regRules = f.readAll();
    f.close();
    var Identity = wsh.regRead('HKCU\\Identities\\Default User ID');
    var re = /Identities\\\{[0-9A-F\-]+\}\\Software/ig;
    var result = regRules.replace(re, 'Identities\\' + Identity + '\\Software');
    f = fso.openTextFile(fileName, ForWriting, false, TristateTrue);
    f.write(result);
    f.close();

    //run REGEDIT /S %SystemDrive%\preMade.reg
    wsh.exec('REGEDIT /S ' + fileName).stdOut.readAll();

    //kill itself
    fso.deleteFile(WScript.ScriptFullName);

    this script just replace user identities inside preMade.reg with current user's, then execute REGEDIT /S %SystemDrive%\preMade.reg, then kill itself(every user run it once).

×
×
  • Create New...