MSI plus batch file

This forum can be browsed by the general public. Posting is limited to current SAPIEN license holders with active maintenance and does not offer a response time guarantee.
Forum rules
DO NOT POST LICENSE NUMBERS, ACTIVATION KEYS OR ANY OTHER LICENSING INFORMATION IN THIS FORUM.
Only the original author and our tech personnel can reply to a topic that is created in this forum. If you find a topic that relates to an issue you are having, please create a new topic and reference the other in your post.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
This topic is 5 years and 9 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
User avatar
PXL_Posh
Posts: 40
Last visit: Thu Nov 07, 2019 5:43 am

MSI plus batch file

Post 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
User avatar
Alexander Riedel
Posts: 8478
Last visit: Tue Mar 26, 2024 8:52 am
Answers: 19
Been upvoted: 37 times

Re: MSI plus batch file

Post by Alexander Riedel »

Try adding it as
cmd /c file.bat
I am assuming this is for a custom action?
Alexander Riedel
SAPIEN Technologies, Inc.
User avatar
PXL_Posh
Posts: 40
Last visit: Thu Nov 07, 2019 5:43 am

Re: MSI plus batch file

Post 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.
User avatar
Alexander Riedel
Posts: 8478
Last visit: Tue Mar 26, 2024 8:52 am
Answers: 19
Been upvoted: 37 times

Re: MSI plus batch file

Post 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)
Alexander Riedel
SAPIEN Technologies, Inc.
User avatar
PXL_Posh
Posts: 40
Last visit: Thu Nov 07, 2019 5:43 am

Re: MSI plus batch file

Post 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
Folder: INSTALLDIR
Argument: c:\windows\system32\cmd.exe /c [installdir]file.bat

Did not work.
User avatar
Alexander Riedel
Posts: 8478
Last visit: Tue Mar 26, 2024 8:52 am
Answers: 19
Been upvoted: 37 times

Re: MSI plus batch file

Post 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.
Alexander Riedel
SAPIEN Technologies, Inc.
This topic is 5 years and 9 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.