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=")
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 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:"
Specify if testing mode should be use (usefull to debug) (default to "0" if not specified in the xml)
Specify if you want to logging (default to "0" if not specified in the xml)
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">
"version" = Your .xml version.
It NEEDS to match the program's version
"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
<!-- 7z.exe should be: near the .exe, near the .xml, near the log or in the path -->
<arguments>x -y -o%systemdrive%\setup\drivers\scanner %systemdrive%\setup\drivers\scanner.7z</arguments>
<arguments>x -y -o%systemdrive%\setup\drivers\di8500\lan %systemdrive%\setup\drivers\di8500\lan.7z</arguments>
<arguments>x -y -o%systemdrive%\setup\drivers\di8500\TM1300 %systemdrive%\setup\drivers\di8500\TM1300.7z</arguments>
<arguments>x -y -o%systemdrive%\setup\drivers\di8500\sigmatel %systemdrive%\setup\drivers\di8500\sigmatel.7z</arguments>
<!-- Add OEM drivers' location to registry -->
<!-- Please see this post: http://www.msfn.org/...drivers devpath -->
Call it like this:
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...)):
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"
- 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.
- [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)
- 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
%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.