- 3 Great Tips for Real-World MSI Packaging
- How to Stop a MSI from Rebooting
- Adding File, Registry, and Shortcut Changes to Your Deployments
- Building an MSI from Scratch with Smart Packager
For years, I only used Before/After snapshot tools to automate my application installs. Those tools can only take you so far, especially when dealing with archaic installers and other software oddities. Being able to build an MSI manually might mean the difference between deploying an app or installing it manually/scripting it.
In this guide, we are going to create an MSI for a really awesome piece of software named TreeSize (that sadly, likes to be installed through an INF). If you would like to follow along with this guide, you can download our test source files from here. Extract the contents to a network share for software storage.
Creating a Blank MSI for Deployment
For most of my MSI management, I used Smart Packager (formally WinInstall LE). If you haven’t, download Smart Packager Free edition and install it on your test VM/management machine. Launch Smart Packager and select Create a new package.
Start by naming your package and setting the package options. For compatibility, ensure that X86 is selected under the architecture options. Click Finish to launch the Package Editor. When TreeSize installs, it creates two files and a shortcut. Our MSI will need to contain these same modifications.
In the Package Editor, select the Files tab and right click in the right column to add your files. Click the New File button in the top right and browse to your extracted files. Add each file and change the Installation location to [WindowsFolder].
With our two files added, head to the Shortcut pane. Add a new shortcut and target it to an existing package file. Select Treesize.exe as the target. Give the shortcut a name and select StartMenuFolder under the location. In the screenshot below, you can see the prepopulated locations. These make selecting locations super easy!
Save your package and exit the Package Editor. You should now be at the Workflow stage in Smart Packager. Select the Testing icon in the bottom left. From here, you can either install/uninstall the application on your local machine or copy the package path for remote execution. Install the application once to verify that creation went smoothly. You should see your Start Menu (or Start Screen) shortcut plus the two files in C:\Windows. You can test TreeSize by going to File – Select Directory – and choosing any folder.
By manually building MSIs, you can continue to streamline your application infrastructure. In our own environment, we had several applications that installed by being copied to a local location. Now we deploy these applications with Group Policy or SCCM! We have also used this same trick to deploy unusual items like Fonts to standard users.
If you have any tips for working with custom deployments, let me know in the comments below!