Introducing the MSI Wizard

Both PrimalScript 2014 and PowerShell Studio 2014 will have to ability to create Windows Installer files (MSI) for your scripts, modules or packaged executables. It works pretty straightforward; put the files you want to install into a folder, enter some additional settings and mucho presto you have an installer. As we previously pointed out, this may be a transition for some of you. So we decided to make a time limited preview copy available for everyone to test.


Let’s go through the fields and options.

1. Product Details

Product Name: That is what you will see in the Control Panel’s “Programs and Features” display.


Product Version: The version number. You should increment that number whenever you create a new build of your product. The installer will use that number to determine if the specific product version is already installed. If it is, it will not install. If you created an MSI with a higher number it will uninstall the old version and then install the newer one.

Company Name: Another field that is shown in the “Programs and Features” display.

Product Type: Your selection here, together with the “64 Bit installer” and “Install for all users” options determines where your files are installed.

The following table shows the locations for a 64 bit OS with “Install for all users” selected

Product Type32 Bit64 Bit
Windows ApplicationC:\Program Files (x86)\Product NameC:\Program Files\Product Name
Script ApplicationC:\Program Files (x86)\Product NameC:\Program Files\Product Name
PowerShell Module%Windir%\SysWOW64\WindowsPowerShell\v1.0\Modules\Product Name%Windir%\System32\WindowsPowerShell\v1.0\Modules\Product Name

Locations for a 64 bit OS with a current user only install selected

Product Type

32 bit

64 bit

Windows Application C:\Program Files (x86)\Product Name C:\Program Files\Product Name
Script Application %HomePath%\Script Applications\Product Name %HomePath%\Script Applications\Product Name
PowerShell Module %HomePath%\WindowsPowerShell\Modules\Product Name %HomePath%\WindowsPowerShell\Modules\Product Name

The folders for a 32 bit OS are the same to those shown here, except that “Program Files (x86)” is always “Program Files” and “SysWOW64” is always “System32”.

Product Icon: This icon file will be embedded in the MSI file and shown in “Programs and Features” with your product.

64-Bit installer: Checking this option prevents installation on 32 bit OS. It also registers COM components as 64 bit components and changes some folder names as indicated earlier.

Install for all users: This will install the application and its shortcuts for all users on a system. In most cases this option will require administrative privileges. It also affects the install folder location for some product types.

Require Administrator: Checking this option will cause Windows Installer to prompt for elevation on Windows Vista or higher. The type of prompt depends on your local UAC (User Access Control) settings and the currently logged on user.

Require PowerShell V3:  With this option checked, the installer checks if PowerShell V3 is installed. If it is not, a prompt to install WinRM 3.0 is displayed and the installation is aborted.

2. Files and Folders

Source Folder: This is the folder where you stage the files you want installed. Arrange and name them exactly as you want them installed on the target machine. Please make sure that you don’t have any stray temporary files in this folder, because anything here will be included in the MSI file. If you have COM object dlls, just place them here as well. They will be recognized as such and registration information will be extracted at build time.

Create Shortcut to: Select the file you want to create a shortcut to in the Windows Start menu. At this time you can only select one file. Typically this is your main executable or script file. For PowerShell modules you can link to the help file for example.

MSI Name: The filename for your MSI. This only affects the actual MSI file and not any of the internal names.

Output Folder: This specifies the location where you want the MSI file to be created. Do not use the staging folder for your software for this or your previous MSI file will be included in the next re-build. If you have not loaded a wizard settings file from someplace else, a .mzw file with the same base name as the MSI name you specified will be created. That file contains all the setting you entered into the wizard’s dialog.

3. Signing

Certificate: A certificate is either code signing certificate installed in your local store or a PFX file you specify in this fields. You can browse for a PFX file using the file browse button(image ) or a certificate using the certificate button (image )

Password: If you specified a PFX file for code signing it may require the use of a password. If so, please enter it here.

Timestamp URL: This URL is used to create a time stamp for the signature used to sign the file. Logging the time of signing allows you MSI file’s signature to remain valid even after the certificate expired.

Use the Signing Wizard to sign the MSI file: If your certificate does not fit the above criteria or of you need to sign with different signature each time you are building a MSI you can use the Microsoft Signing Wizard. Any settings entered above will be ignored and the wizard will guide you through the signing process.

4. Rebuild previously configured installers

If you need an installer you most likely will re-release new builds or versions of what you are installing on other computers. If you just need to rebuild the current version with the current settings because the MSI was deleted, a file was added or any other change that does not affect the version number, you can just run MSIWizard.exe <name>.mzw
That will just produce a new MSI with the current settings and whatever files you have staged in the source folder.

If you want to release a new version of your application or module, open the MSI Wizard use the “Load…” button to load the mzw file for your installer and update any settings that need change. The version number must be incremented to a higher number in either one of its three components ( to compel Windows Installer to update your software. If you do not increment the version number you will get an error message indicating that this version is already installed on any target machine you are trying to update.

The version number is not automatically incremented at this time, so it is up to you to do that.

It is very important that you keep and re-use the wizard file (.mzw) for subsequent builds of your installer. This file contains  important upgrade and package codes that allow Windows Installer to determine if a product is already installed.
The name alone has no meaning to Windows Installer, so please do not discard this file after building your first installer.

Please note:

The SAPIEN MSI Wizard uses parts of the WiX Toolkit to create Windows Installers. The complete WiX Toolkit can be found here

The WiX Toolkit is open source software and you can find the source code at the location mentioned above. Please note that the SAPIEN MSI Wizard is not open source and copyrighted software.

Go get it:

You can download a free, time limited community preview version of this from here:

MSIWizard (64 Bit)

MSIWizard (32 Bit)