• Announcements

    • xper

      MSFN Sponsorship and AdBlockers!   07/10/2016

      Dear members, MSFN is made available via subscriptions, donations and advertising revenue. The use of ad-blocking software hurts the site. Please disable ad-blocking software or set an exception for MSFN. Alternatively, become a site sponsor and ads will be disabled automatically and by subscribing you get other sponsor benefits.
Sign in to follow this  
Followers 0
big_gie

New tool! Run multiple programs from winnt.sif

64 posts in this topic

Updated: August 15th 2004

v0.8.2

As you may know, the winnt.sif's DetachedProgram section only allows you to run ONE program... And you can't execute a batch file to!

So I wrote a small program that will look in a file and execute what it contains. It even support environment variables! Even %CD% witch resolves to the drive you installed Windows from! (taken from %Windir%\system32\$winnt$.inf's "dospath=")

Usage:

mt39.exe /xml:file.xml:/xml /log:file.log:/log /var:<Variable name>=<Variable value>:/var /testingmode=[0|1] /logging=[0|1]

  • /xml:Full\path\to\file.xml:/xml OR /xml:file.xml:/xml
    The second one will make mt39 looks for "file.xml":
    • in the same directory as the exe
    • in the "current directory" if the later is not found. This "current directory" can depend on many thing, so I can't tell what it will be! Yours to see :)
      Default value for the path is the same as the exe's. Default file name is "default.xml"

    [*]/log:Full\path\to\file.log:/log OR /log:file.log:/log

    The second one will try to create the "file.log":

    • in the same directory as the xml
    • if it can't (write protected for example), in the same directory as the exe
    • if it can't, in the "currect directory"
    • if it can't, in the %TEMP% folder
    • if it can't, then you're really not lucky :rolleyes: Logging will be disable
      Default value for the path is the same as the xml's. Default file name is "mt39_<XML file name (no ext)>.log" (like "mt39_default.log")

    [*]/var:<Variable name>=<Variable value>:/var

    You can set as many variables like this as you want. You will be able to use those variables inside your xml file. For example, if you want to force the %CD% variable to be something else, you would use: /var:CD=F::/var and now in the xml, when you will use the %CD% variable, it will be parsed to "F:"

    [*]/testingmode=[0|1]

    Specify if testing mode should be use (usefull to debug) (default to "0" if not specified in the xml)

    [*]/logging=[0|1]

    Specify if you want to logging (default to "0" if not specified in the xml)

The configuration file is a xml file with programs to run.

Look in the xml from the package to see its usage.

If you don't specify a configuration files, mt39.exe uses the default one called "default.xml" in the same directory as the exe.

<?xml version="1.0" encoding="ISO-8859-2" standalone="no"?>

<!--

    Note that the new encoding is ISO-8859-2

    This will let SOME special characters like accent in french. I think

    it should work with spanish, german, and other european languages. Please

    tell me if something doesn't work.

-->

<mt39 version="0.8.1" testingmode="0" logging="1">

<!--

    [MANDATORY]

    "version" = Your .xml version.

        It NEEDS to match the program's version

    [Optionnals]

    "testingmode" = 0 (default if not present) or 1

        mt39 will not execute files but pop you a MessageBox with informations

    "logging" = 0 (default if not present) or 1

        Will launch the logging feature if enabled

        NOT YET IMPLEMENTED

-->

    <item>

        <!-- 7z.exe should be: near the .exe, near the .xml, near the log or in the path -->

        <program>7z</program>

        <arguments>x -y -o%systemdrive%\setup\drivers\scanner %systemdrive%\setup\drivers\scanner.7z</arguments>

        <hide>1</hide>

        <wait>300</wait>

    </item>

    <item>

        <program>7z</program>

        <arguments>x -y -o%systemdrive%\setup\drivers\di8500\lan %systemdrive%\setup\drivers\di8500\lan.7z</arguments>

        <hide>1</hide>

        <wait>300</wait>

    </item>

    <item>

        <program>7z</program>

        <arguments>x -y -o%systemdrive%\setup\drivers\di8500\TM1300 %systemdrive%\setup\drivers\di8500\TM1300.7z</arguments>

        <hide>1</hide>

        <wait>300</wait>

    </item>

    <item>

        <program>%SourceDrive%\Programmes\7zip\7z.exe</program>

        <arguments>x -y -o%systemdrive%\setup\drivers\di8500\sigmatel %systemdrive%\setup\drivers\di8500\sigmatel.7z</arguments>

        <hide>1</hide>

        <wait>300</wait>

    </item>

<item>

  <!-- Add OEM drivers' location to registry -->

        <!-- Please see this post: http://www.msfn.org/board/index.php?showto...drivers+devpath -->

  <program>%SourceDrive%\Programmes\drivers\devpath.exe</program>

  <arguments>%systemdrive%\setup\drivers</arguments>

  <hide>1</hide>

  <wait>300</wait>

</item>

</mt39>

Call it like this:

[GuiUnattended]

    ...

    DetachedProgram="%systemdrive%\setup\mt39.exe"

    Arguments="/xml:%systemdrive%\setup\dd4550.xml:/xml /log:your\log\file.log:/log /var:var1=value1:/var /var:var2=value2:/var /testingmode:1 /logging:1"

    ...

or like this to use the default config (default.xml must be in the same directory or in the current directory (I don't know what is it though @t-39...)):

[GuiUnattended]

    ...

    DetachedProgram="%systemdrive%\setup\mt39.exe"

    ...

NOTES:

  • The XML should be encoded in ISO-8859-2 as is seems to work better... I'm hping to be moving to full UTF-8 enconding, but for now, ISO 8859-2 should do it.
  • Check the xml's "version" attribute. It should match the program's version (this is because the xml implementation is quite simple and crashes if it try to access a tag which is not present. To be able to add more features and to "force" users to check their xml file syntaxt to follow the program's evolution, I added this tag). To verify the program's version, run it with "/?" switch (or -h, or -?, or --h, or /h, or... ) or "-v" for the version.

Actual limitations:

  • None known :D

TODO:

  • [ADDED]Giving a variable by command line that will be parsed in the xml.
  • [ADDED]Better command line arguments handling.
  • [ADDED] Add a "test" tag whitch will tell mt39 to check the XML syntaxt, verify if files exists, etc. and reports (MessageBox and/or log file)
  • [ADDED]Add a tag checking routine to prevent program crash. (IMPORTANT)
  • Full support for Unicode (to support special characters like &ecute; and others)

Please post your questions, bugs, comments and suggestion so I can make mt39 better :D

Changelog:

  • 15 08 2004 (v0.8.2)
    Bug corrected that returned the wrong path for a program.
  • 13 08 2004 (v0.8.1)
    It is now possible to enter only a filename instead of a full pathname:
    mt39 will look near the exe, near the xml, near the log and in the path environment variable, in that order.
    New variables supported:
    $mt39_PathToXml for the full path to the xml file (without file name.ext)
    $mt39_PathToExe for the full path to the exe file (without file name.ext)
    $mt39_PathToLog for the full path to the log file (without file name.ext)
    $mt39_NameOfXml for the name of the xml (ex.: file.xml)
    $mt39_NameOfXmlNoExt for the name of the xml without extension (ex.: file)
    $mt39_NameOfLog for the name of the log (ex.: file.log)
    $mt39_NameOfLogNoExt for the name of the xml without extension (ex.: file)
    $mt39_OriginalArguments for the complete parameters given to mt39
    %ComputerName% for the computer name
    Note:
    %CD% is now Current Directory!!!!!!!!!
    There is no more %CDROM% because there could be many CDROMS...
    Use SourceDrive to get the <DriveLetter>: string
  • 04 08 2004 (v0.7.1)
    Bug corrected with environment variables longer than 20 characters couldn't be resolved (%userprofile%, %appdata%, etc.)
  • 31 07 2004 (v0.7)
    Now support a full set of command line switches.
  • 27 07 2004 (v0.6.1)
    %CD% parsion bug corrected
  • 25 07 2004 (v0.6)
    Bug corrected when ran from somewhere else than current directory.
    The .exe is now packed with UPX (http://upx.sourceforge.net/) for smaller size
    If you only specify the xml filename (without full path), mt39 will look in the .exe's directory and in the current directory.
    The logging file will be created near the .xml file. If not possible (.xml is on a CD), it will be created near the .exe. If not possible, in the current directory. If not possible, no log file.
    Some more command line option will be there soon.

mt39_082.7z

0

Share this post


Link to post
Share on other sites

Hmm.. this could be an interesting idea. Although, I fail to see what extra advantages this has over using a batch file to run all the required programs.

Maybe it if sets a %CD% variable or something, it might be more interesting.

0

Share this post


Link to post
Share on other sites

Good work big gie!

Now I can simply make different archives, which is much easier to maintain than one big archive with both drivers and programs!

Thank you!

0

Share this post


Link to post
Share on other sites
Now I can simply make different archives, which is much easier to maintain than one big archive with both drivers and programs!

Yes, one archieve for one computer drivers, another archieve for another computer, and another one for common drivers (nvidia) which are (beta) updated often (from nVision)

Or even one archieve per driver...

0

Share this post


Link to post
Share on other sites
You can't run batch file @ t-39...

Yes you can...

You can't run .cmd files (Windows NT Command Script).

You can run .bat files (MS-DOS Batch File).

0

Share this post


Link to post
Share on other sites

Hum... I've tryed a simple .bat file and it didn't worked... I could have done need more testing though...

At least this tool doesn't show a console window... (I need to defend my work, no? :))

0

Share this post


Link to post
Share on other sites

lol... that's where cmdow.exe comes in handy... :)

But true, at least your program doesn't show anything.

0

Share this post


Link to post
Share on other sites

looks exciting.

Dudes, keep your eyes peeled - this app will get used in some ways which the author never expected (by yours truly!!).

0

Share this post


Link to post
Share on other sites

Hmm.. you've got me curious now... looking forward to seeing what you do.

0

Share this post


Link to post
Share on other sites

running .cmd in T-39 has some restrictions. i cant name it.

reg hives seems not all availiable, cant get SourcePath from HKLM, but i can add regs to HKCU\Environment.

there's a work around for SourcePath retrieving from %SystemRoot%\system32\$winnt$.inf, value "dospath=".

[GuiUnattended]
   DetachedProgram = ".\system32\cmd.exe"
   Arguments="/C START /MIN FOR %I IN (D: E: F: G: H:) DO (IF EXIST %I\$OEM$\Detached.CMD (%I\$OEM$\Detached.CMD) ELSE (FOR /D %J IN (%I\*) DO (IF EXIST %J\$OEM$\Detached.CMD (%J\$OEM$\Detached.CMD))))"

note: i have some problem with oempreinstall=yes, so i use oemreinstall=no. the arguments for detached program searchs $oem$\detached.cmd in every drive listed, and every 1st level folders.

Detached.CMD

0

Share this post


Link to post
Share on other sites

thanks mate

I'll try to add this soon so there will be a %CD% variable.

0

Share this post


Link to post
Share on other sites

Thanks zippy for the hint on %windir%\system32\$winnt$.inf to look for a %CD% variable. mt39 is now updated :)

0

Share this post


Link to post
Share on other sites

Using the mt39 method, my SFX archive fails to extract and it does not pop up any window indicating % extraction completed.

The old way works:

[GuiUnattended]
   AdminPassword=*
   AutoLogon=Yes
   OEMSkipWelcome=1
   OEMSkipRegional=1
   TimeZone=35
   DetachedProgram="%systemdrive%\Drivers.exe"
   Arguments="-y /q /r:n"

But not the mt39 way:

[GuiUnattended]
   AdminPassword=*
   AutoLogon=Yes
   OEMSkipWelcome=1
   OEMSkipRegional=1
   TimeZone=35
   DetachedProgram="%systemdrive%\mt39.exe"
   Arguments="%systemdrive%\default.xml"

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<mt39>
   <version>0.3</version>
   <item>
       <program>%systemdrive%\Drivers.exe</program>
       <arguments>-y /q /r:n</arguments>
       <hide>0</hide>
       <wait>0</wait>
   </item>
</mt39>

Did I do something wrong here? I hope to employ the mt39 method to add more commands later to take care of rogue dialog boxes that may pop up on some vendor driver installs (3ware RAID drivers in particular). This is for home use. Thanks!

0

Share this post


Link to post
Share on other sites

I'm going to try this tool.

but new to 7zip archiver, could you confirm the settings when i'm creating my PnP drivers archive.

Archive format: 7z

Compression level: Ultra

Compression method: LZMA

Dictionary size: 32 MB

World size: 64

Create Solid archive YES

Parameters: none

on my first attempt, the archive extract well on the running box used to create it but unable to extract it during the unattended install :

Error: file is not supported archive

the command used in mt39.exe is 7z.exe x -y -o%systemdrive% %systemdrive%\PnPDrvrs.7z

and both files exe and archive are copied in %systemdrive%

It's not a mt39.exe error but rather an operator error.

Do somebody use the command line to build his archive and give me the right syntax (especially the switches used).

Thanks

found some answers with a search "7zip" in Drivers section...

Nethertheless, you can answer here for more details...

may be off topic...

0

Share this post


Link to post
Share on other sites
Using the mt39 method, my SFX archive fails to extract and it does not pop up any window indicating % extraction completed.

The old way works:

[GuiUnattended]
   AdminPassword=*
   AutoLogon=Yes
   OEMSkipWelcome=1
   OEMSkipRegional=1
   TimeZone=35
   DetachedProgram="%systemdrive%\Drivers.exe"
   Arguments="-y /q /r:n"

But not the mt39 way:

[GuiUnattended]
   AdminPassword=*
   AutoLogon=Yes
   OEMSkipWelcome=1
   OEMSkipRegional=1
   TimeZone=35
   DetachedProgram="%systemdrive%\mt39.exe"
   Arguments="%systemdrive%\default.xml"

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<mt39>
   <version>0.3</version>
   <item>
       <program>%systemdrive%\Drivers.exe</program>
       <arguments>-y /q /r:n</arguments>
       <hide>0</hide>
       <wait>0</wait>
   </item>
</mt39>

Did I do something wrong here? I hope to employ the mt39 method to add more commands later to take care of rogue dialog boxes that may pop up on some vendor driver installs (3ware RAID drivers in particular). This is for home use. Thanks!

Something I forgot to mention in the main post:

Since the XML implentation is quite simple (TinyXML v2.3.1 Beta) the program crashes if the xml isn't valid... So to be sure that the xml and program have the same version (I could add some feature, so the xml file could change), I've included the <version></version> tag in the xml file. This value needs to match the program's version.

Actually, mt39 is at version 0.3.1 so your xml should have:

<version>0.3.1</version> instead of <version>0.3</version>

Try it in windows before to see if it works (place the Drivers.exe on youre C: drive) to see if it exctract. It could be also a character encoding problem. I used PSPad v4.3.0 to edit the xml file. With this, it is easy to set the file character encoding to UTF-8 (wich you should use)

I'll had a feature to test things (check xml, looks for the correct files but don't execute them and report with a message box...) and maybe logging...

Hope this helped...

0

Share this post


Link to post
Share on other sites
Archive format: 7z

Compression level: Ultra

Compression method: LZMA

Dictionary size: 32 MB

World size: 64

Create Solid archive YES

Parameters: none

Thats what I'm using :)

It should be ok. I'm using the GUI (left click on files->7zip->Add to archive... then the same options as you) and it works fine, in windows and @t-39 (I'm using this since before mt39 so it should be ok). Have you tested the archieve in windows? Just after creating it? I think the first time I used 7zip the archieve I created didn't worked and I was scared 7zip wasn't working correctly but never had trouble with it...

Can you post a screenshot of the error?

Hope this helped too...

0

Share this post


Link to post
Share on other sites

I have a poblem, mt39 says that it can't open default.xml.

heres default.xml

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!--
   mt39.exe
   Program to execute things @ t-39 of Windows XP unattended installation
   The WinMain section was taken from http://winprog.org/tutorial/simple_window.html
       (With step 2 and 3 stripped)
   The exec.cpp was taken from GOFF Concepts Intuitive Software
   http://goff.nu/techarticles/development/cpp/createprocess.html
   The XML parser is TinyXML avaible here under the zlib license:
   http://www.grinninglizard.com/tinyxml/index.html

   18 07 2004
   v0.3
       Now uses xml files for config!
           program: the program to execute. May contain variables, spaces, etc.
           arguments: arguments of the program. May contain variables, spaces, etc.
           hide: 1 to hide the window, 0 to show it.
           wait: > 1 Number of seconds to wait for the process. After this time,
                     mt39 will continue with other program ignoring the current process.
                 = 0 Wait until the process finishes.
                 = -1 Will not wait: will launch the next item right away.
       Limitations: Some problems with wide characters. It won't be possible to
                    use special characters (like &ecute; and other accents)


-->
<mt39>
   <version>0.3.1</version>
   <item>
       <!-- remaping drive -->
       <program>%systemdrive%\Install\MapDice.cmd</program>
       <arguments></arguments>
       <hide>0</hide>
       <wait>0</wait>
   </item>
   <item>
       <!-- move program file dir -->
       <program>%systemdrive%\Install\MoveProgramDIR.reg</program>
       <arguments></arguments>
       <hide>0</hide>
       <wait>0</wait>
   </item>
   <item>
       <!-- move temp folder -->
       <program>%systemdrive%\install\MovTempFile.bat</program>
       <arguments></arguments>
       <hide>0</hide>
       <wait>0</wait>
   </item>
</mt39>

and this is my winnt.sif:

;SetupMgrTag
[Data]
   AutoPartition=0
   MsDosInitiated="0"
   UnattendedInstall="Yes"

[Unattended]
   FileSystem=*
   UnattendMode=FullUnattended
   OemSkipEula=Yes
   OemPreinstall=Yes
   UnattendSwitch="yes"
   TargetPath=\WINDOWS
   ProgramFilesDir="p:\Program Files"
   CommonProgramFilesDir="p:\Program Files\Common Files"

[GuiUnattended]
   AdminPassword=I am not telling!
   EncryptedAdminPassword=Yes
   OEMSkipRegional=1
   TimeZone=35
   OemSkipWelcome=1
   ProfilesDir="p:\Documents and Settings\"
   DetachedProgram="%systemdrive%\Install\DetachedProgram\mt39.exe"
   Arguments="%systemdrive%\Install\DetachedProgram\default.xml"

[UserData]
   ProductID=babby-would-loved-tonot-name
   FullName="comp1"
   OrgName="Famly"
   ComputerName=Level1-Sys1-Main

[Display]
   BitsPerPel=16
   Xresolution=800
   YResolution=600

[TapiLocation]
   CountryCode=1
   Dialing=Tone
   AreaCode=410

[Identification]
   JoinWorkgroup=Home

[Networking]
   InstallDefaultComponents=No

[NetAdapters]
   Adapter1=params.Adapter1

[params.Adapter1]
   INFID=*

[NetClients]
   MS_MSClient=params.MS_MSClient

[NetProtocols]
   MS_TCPIP=params.MS_TCPIP

[params.MS_TCPIP]
   DNS=Yes
   UseDomainNameDevolution=No
   EnableLMHosts=Yes
   AdapterSections=params.MS_TCPIP.Adapter1

[params.MS_TCPIP.Adapter1]
   SpecificTo=Adapter1
   DHCP=Yes
   WINS=No
   NetBIOSOptions=0

[Components]
   msmsgs=off
   msnexplr=off

[Shell]
   DefaultStartPanelOff = Yes
   DefaultThemesOff = Yes

[GuiRunOnce]
   %systemdrive%\install\setup.bat

I have tryed it with and without Arguments(it is in the same folder so it does not need them). withour arguments it gives a massge and does not work, but with arguments it does not give a massge but does not work also.

0

Share this post


Link to post
Share on other sites

Yeah if you remove a tag it will crash (there isn't a "checking" method to see if the tag exist, and if it doesn't and the program is trying to access it, TinyXML will crash... I'll try to add checking soon).

Be sure that your xml file is encoded in UTF-8. Notepad supports this (save as -> encoding -> UTF-8), ConTEXT doesn't, PSPad does (thats what I'm using and I recommend it, its freeware).

Have you found the problem? What was it?

0

Share this post


Link to post
Share on other sites

I Have not found the problem, I only found some thing that I missspelld, but it did not fix it.

"Cannot open file "default.xml" for reading, exiting"

I saved as UTF-8.

0

Share this post


Link to post
Share on other sites

When you say it tells you:

"Cannot open file "default.xml" for reading, exiting"

what was the command line you gave? None? Or if you gave it another one, it could be a bug... I don't have the source here at work so I'll try to check it this evening.

What about open source? If people like it enought it could be possible...

0

Share this post


Link to post
Share on other sites

I did get mt39 to work. I had to re-download the package to get the updated version of mt39. My copy was corrupt or something. I'm excited by the potential of this utility and learned something new in the process.

Unfortunately for me, I found that jscript can't execute that early so I can't put this utility to good use until I find another way to dismiss the rogue dialog box that pops up on succesfull install of 3ware RAID driver. Not really unattended install until I resolve this problem. :)

0

Share this post


Link to post
Share on other sites

@MadCat1968

Never tryed to see if scripts can be executed @t-39, but have you tryed to execute "%windir%\wscript.exe path\to\your\script.js" and not only path\to\your\script.js ?

Also, are you sure you need to install your drivers? You're aware of MSFN's unattended driver guide?

0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0

  • Recently Browsing   0 members

    No registered users viewing this page.