I need to sign the MSI file and also the final EXE file. I can't use the built-in sign code because it doesn't work with EV certs, so I run the signtool command "After Build". This works fine for signing the EXE, but is there a way to run a command after the MSI is created, but before the EXE is built? This way I'll have a signed MSI and a signed EXE. Some customers extract the MSI from the EXE, while others just want the MSI, so I need to have it signed. Thank you.
Announcement
Collapse
No announcement yet.
How to run a command after msi is built, but before exe is made
Collapse
X
-
Understood. To achieve what you want, I suggest that you use the "Custom" option.
Go to Tools > Bootstrapper Designer, create a new project based on the "Extract and Run Single MSI" template.
Add your existing MSI file to the list of files, and give it the ID "mainsetup".
Save the bootstrapper project, and build to see if there are errors.
Run the exe which was created, and see if the MSI starts normally.
If everything is okay, you can now build everything from the command line. Set the bootstrapper to "None" and save the updated project. You can now build the MSI with a batch file (see the "Unattended Build Options" in the MSI Factory help file), then you can sign the MSI by invoking signtool with the /a parameter, then run the bootstrapper builder project (again, command line parameters can be found in the docs, see "Using IRMakeBootstrap.exe" in the bootstrapper help file), and the fourth and final step would be calling signtool again, but now to sign the executable.
The bootstrapper built in this manner can still process the "/EXTRACTMSI" command line argument, allowing your client to save the MSI if needed, but it gives you more much options than the standard option.
Ulrich
- Likes 1
Comment
-
I took my existing .msifact, added the bootstrapper based on the Extract and Run Single MSI, renamed the MSI in the list of files to "mainsetup", but I get this error:
Generating bootstrapper...
LZMA 9.38 beta : Igor Pavlov : Public domain : 2015-01-03
LZMA 9.38 beta : Igor Pavlov : Public domain : 2015-01-03
Indigo Rose MSI Bootstrapper
Copyright (c) 2015 Indigo Rose Corporation - www.indigorose.com
Initialize folders...
Loading configuration file...
Copy setup executable stub...
Writing Version Resources...
Adding bootstrapper execution level manifest...
Adding files...
c:\temp\mainscript.lua.tmp
c:\temp\_global_functions.lua.tmp
msi
ERROR: LZMA compression failed: msi -> c:\temp\sfwD8D6.tmp
Cleaning up temporary files...
Bootstrap build failed: 6
LZMA 9.38 beta : Igor Pavlov : Public domain : 2015-01-03
Error: can not open input file msi
Error 1011: IRMakeBootstrap.exe returned error: 6
Deleting temporary files
Build FAILED! Error: 1011 - Error executing pre/post build step
Comment
-
This is for the bootstrapper.
The other option is to code the variables, such as the value needed for strProductName, directly into the script, as mentioned in the comment I highlighted above. In this case you would not need to pass arguments (command line options), but this is up to you.
Ulrich
- Likes 1
Comment
Comment