Jump to content

New tool! Run multiple programs from winnt.sif


Recommended Posts

Figured out a Win32 application to dismiss the rogue dialog box that pops up on successful install of the 3ware RAID driver at T33 minutes ("3wareAcknowledge.cpp"):

#include <windows.h>

int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance,
   LPSTR lpCmdLine, int nCmdShow)
{
   HWND hwnd = NULL;

   while (hwnd == NULL)
   {
       hwnd = FindWindow (NULL, "Installation Complete");
       Sleep (1000);
   }

   SendMessage (hwnd, WM_CLOSE, 0, 0);
   return 0;
}

Compiled "3wareAcknowledge" binary takes only 36KB of disk space.

Here's my mt39 script:

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

When the 3ware "Installation Complete" dialog box pops up at T33 minutes, the "3wareAcknowledge" program, which was spawned off as a background process by mt39, kicks in and dismisses the dialog box automatically.

You may have a bug with null argument processing with mt39 (haven't tried your latest version yet). I had to pass a bogus argument for "3wareAcknowledge" to prevent mt39 from crashing (see script above).

Thank you for the mt39 utility!

Link to comment
Share on other sites


I tough of it yesterday, you could have used an AutoIT script to do the same. Maybe it would have been easier but since you've made a cpp exe, the lader is surely smaller then the compiled AutoIT script...

Glad to see you like mt39 :)

I'll need to check out the XML parser to see what it does when there is no arguments given... I'm sure I didn't used TinyXML's "full" capacity so my implementation could be not as stable as it could be...

I've created a SourceForge project but didn't have the time to release anything. Everyone who would like to help will be welcome :rolleyes:

Link to comment
Share on other sites

even with the new .4 I still get that errer.

I think MadCat1968 found the problem:

You may have a bug with null argument processing with mt39 (haven't tried your latest version yet). I had to pass a bogus argument for "3wareAcknowledge" to prevent mt39 from crashing (see script above).

I've tested your xml posted here and it crashed. You didn't have any arguments in the <argument> tag:

    <!-- remaping drive -->

    <program>%systemdrive%\Install\MapDice.cmd</program>

    <arguments></arguments>

    <hide>0</hide>

    <wait>0</wait>

I changed this to:

    <!-- remaping drive -->

    <program>%systemdrive%\Install\MapDice.cmd</program>

    <arguments>bogus</arguments>

    <hide>0</hide>

    <wait>0</wait>

And it seemed to work... Give it a try

Link to comment
Share on other sites

Do you think it could be interesting to pass a value as a variable to mt39.exe

winnt.sif

[GuiUnattended]
   ...
   DetachedProgram="%systemdrive%\setup\mt39.exe"
   Arguments="%systemdrive%\setup\default.xml /DevicePath="PnPDrvrs"
   ...

in order to use a value that isn't an existing environnement variable for substitution in the xml file.

<?xml version="1.0" encoding="ISO-8859-2" standalone="no"?>
<mt39 version="0.5" testingmode="0" logging="1">
   <item>
       <program>%systemdrive%\setup\7z.exe</program>
       <arguments>x -y -o%systemdrive%\%DevicePath% %systemdrive%\setup\CfgSets\Fennel\drivers.7z</arguments>
       <hide>1</hide>
       <wait>300</wait>
   </item>
   <item>
       <program>%systemdrive%\setup\7z.exe</program>
       <arguments>x -y -o%systemdrive%\%DevicePath% %systemdrive%\setup\CfgSets\Other\other.7z</arguments>
       <hide>1</hide>
       <wait>300</wait>
   </item>
   <item>
       <program>%systemdrive%\Setup\devpath.exe</program>
       <arguments>%systemdrive%\%DevicePath%</arguments>
       <hide>1</hide>
       <wait>300</wait>
   </item>
</mt39>

devpath.exe is a 8.3 naming convention renamed exe of the SetDevicePath.exe tool written by Pyron :

SOLVED: drivers from CD , possible even without winnt.sif!

Command Line Syntax:

     DevPath path

Description:

     DevPath.exe searchs installer INF file in specified path subdirectories
  and add path for all subdirectories containing an INF file
  to the "DevicePath" value at registry key:
  HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion
                     
Arguments:

     path  specifies a path to process

Example:

     DevPath c:\PNPDrvrs
  adds the path of PnP devices INFs files found in all the
  subdirectories in specified path C:\PNPDrvrs

It may be possible to have a winnt.sif with variable not set and dynamically build the path in the registry AND to set the name of the main folder only with this variable.

[Unattended]
       UnattendMode=FullUnattended
       DriverSigningPolicy=Ignore
      OemPnPDriversPath=   ******blank******

Another alternative would be the ability to set this value with a supplemental XML line rather than supplemental switch but don't know how the syntax could be.

The purpose is to make the whole process needing less customization in XML code and winnt.sif

Link to comment
Share on other sites

Do you think it could be interesting to pass a value as a variable to mt39.exe

winnt.sif

[GuiUnattended]
   ...
   DetachedProgram="%systemdrive%\setup\mt39.exe"
   Arguments="%systemdrive%\setup\default.xml /DevicePath="PnPDrvrs"
   ...

Yes that could be a nice idea... :)

Maybe a command line like:

mt39.exe /xml:defaul.xml /var:DevicePath="PnPDrvrs",OtherVar="SomewhereElse",AnotherOne="YouSeeThePoint"

Many ideas come from XPlode as you can see :rolleyes: They do quite the same thing, while mt39 doesn't show anything...

Link to comment
Share on other sites

v0.6.1 is up

It corrects a bug present in the %CD% parsing function...

I'm currently implementing using better command line arguments like:

/xml:pat\to\xml.xml:/xml

/log:pat\with spaces\to\logfile.log:/log

/var:var1=value1:/var

/var:var2=value2:/var

/testingmode:1

/logging:1

for better control.

I use the "/xml:" and ":/xml" to prevent problems with spaces in paths. Also, having 5 characters beside the arguments will prevent the program from stopping reading when there is a space or when a double quote is present in the argument...

/xml:"Path\with some\spaces\in\it\file.xml":/xml

/var:var1=This is a quote " and another one ". They will be present in the variable "var1":/var

Link to comment
Share on other sites

Well maybe. I never used diskpart. I do know though that it can only be run in Windows. mt39 can only be run in windows too.

Why would you want to format your drive when Windows is installing/finished installing?? Or maybe you'd want to use it sometime else...

Link to comment
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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...