Page 1 of 1

MSI plus batch file

Posted: Wed Jun 13, 2018 7:27 am
by PXL_Posh
Powershell Studio 2018 64 bit
Windows 10 64bit VM

Does a batch file require any special arguments to run?
I opened the MSI with ORCA and it seems to be plainly calling the file.bat.
When manually run the batch file successfully adds the registry entry without error.

Confirmed the following:
  • The bat is added to the imported files.
    Batch file called without argument.
    With and Without system account (no impersonation) enabled.

The installer fails every time on the batch file.
Eventviewer points to the batch file.

Thank you

Re: MSI plus batch file

Posted: Wed Jun 13, 2018 8:44 am
by Alexander Riedel
Try adding it as
cmd /c file.bat
I am assuming this is for a custom action?

Re: MSI plus batch file

Posted: Wed Jun 13, 2018 10:20 am
by PXL_Posh
Custom action is correct.

File: cmd.exe
Folder: SystemFolder
Argument: /c [installdir]file.bat

Does this look correct?

Update: This did not work

Error 1722. There is a problem with this Windows Installer package. A program run as part of the setup did not finish as expected. Contact your support personnel or package vendor. Action Unrestricted, location: C:\Windows\SysWOW64\, command: cmd.exe /c C:\Program Files\Contoso\AdminToolKit\file.bat

Running c:\windows\syswow64\cmd.exe /c C:\Program Files\Contoso\AdminToolKit\file.bat failed
Changing syswow64 to system32 succeeded by executing it in the windows run line:

c:\windows\system32\cmd.exe /c C:\Program Files\Contoso\AdminToolKit\file.bat succeeded

Just have to figure out how to make it use system32, changing it to windowsfolder did not succeed.

Re: MSI plus batch file

Posted: Wed Jun 13, 2018 10:52 am
by Alexander Riedel
Specify C:\Windows\Sysnative\cmd.exe
That should call the right thing on 32 and 64 bit machines
(Note: I did not try that)

Re: MSI plus batch file

Posted: Wed Jun 13, 2018 11:16 am
by PXL_Posh
How would I organize that in the setup?

File: cmd.exe
Folder: C:\Windows\Sysnative
Argument: /c [installdir]file.bat

Did not accept folder.

File: C:\Windows\Sysnative\cmd.exe
Folder: ( cannot be blank ) INSTALLDIR
Argugment: /c [installdir]file.bat

did not like command

File: cmd.exe
Argument: c:\windows\system32\cmd.exe /c [installdir]file.bat

Did not work.

Re: MSI plus batch file

Posted: Wed Jun 13, 2018 1:08 pm
by Alexander Riedel
Please be a little more precise in your post. "Did not accept folder.", for example. The dev team tells me they do not validate folders, so you need to tell who did not accept what.
"Did not like command". I doubt there was a messagebox that said "Ew, I do not like this command" :D
And "did not work" can be oh so many things.
Please provide the actual error message or screenshots.