The information in this article applies to the SAPIEN Script Packager in PrimalScript 8.1.181 and PowerShell Studio 5.8.222.
SAPIEN Script Packager has had the ability to create MSI files for some years now. The intention has always been to provide a simple way to create an installer for your script application or tool you developed with PrimalScript or PowerShell Studio. But what if, over time, you have made many of these applications and want to give your users a simple way to install them? While creating a script that sequentially installs your applications one after another is relatively simple, giving your users choices is another matter.
We will use a Web Installer for SAPIEN DevOps Suite to illustrate the requirements and abilities of this new feature.
This is what the end result looks like:
So, how do you get to the end result?
The new version of SAPIEN Script Packager has two new ribbon buttons (Build Web Installer, Run Web Installer) and a new Web Installer section in the Tasks Pane on the left. The buttons are self-explanatory, but if you have any questions, let us know in the comments below.
Web Installer Settings
Clicking on Web Installer > Settings will display the page shown above. The first section contains the general settings for your web installer:
The Web Installer Caption will display at the top of the application. This field is also used to build the executable name, and spaces will be deleted for this purpose. For example, ‘SAPIEN DevOps Suite’ becomes ‘SAPIENDevOpsSuite.exe’
An Output Folder is required, which can be an absolute path or a path relative to the script file, as shown here.
You will need an Icon file and an Image strip for the Web Installer’s list. The icon can be any Windows icon you want to use. Because of different scaling factors, we recommend that the icon contains 24×24, 32×32, and 48×48 images at the very least. This icon will also display in front of your caption on top of the application.
The image list is a single horizontal PNG (no other formats are presently available) containing multiple 36×36 images for your installers.
Why 36×36? It allows for the standard 32×32 icon size to be used with a 2-pixel border on each side, making your list look nicer. Please make sure that this 2-pixel border is set to be transparent.
We use the Icon Workshop from our friends at Axialis to create image strips as shown below. You can use whatever image editor you have, including Windows Paint.
The Certificate settings are optional and are identical to what you see in the Script Packager and MSI sections.
The Platform boxes determine which types of executable files are generated. Whether you need one or all will depend on your target environment. The choices are 32-Bit Windows, 64-Bit Windows, and Windows ARM64. Regarding ARM64—we only test this on Windows 11 ARM64, not on any prior versions.
Now that we have reviewed the general options let’s dive into the details of each individual entry. Here is an entry for CIM Explorer 2023:
The Name is what is displayed in the list of the Web Installer.
The URL is where the Web Installer can download the file from. The assumption is that you have internet access and that any proxy server is configured to allow traffic to and from this URL.
You may also have to add a firewall exception for your web installer in very restricted environments. If all else fails, the web installer will attempt to download the designated file with your default browser.
You can specify MSI files here, or executable file installers like we have here at SAPIEN. Executable installers must be able to process standard MSIExec command line switches.
We can only test some of the many different installer tools out there. So if you do not use an MSI created with the SAPIEN Script Packager and run into trouble, please upload a sample to our support upload page and let us know what tool you used.
The Image index designates which image is used from the previously mentioned image strip. Counting starts at 0.
The Web Installer can also display the installed application’s version or at least its status. For this, it needs a path to a file or a registry entry containing a path. We will get to the registry part in a little bit.
If it can find a version, it will display that version. If the file exists but has no version, the status will show ‘Installed’. If you do not specify a file path or a registry key, the status will simply be left empty. The file path takes precedence over the registry key, so generally, you do not need to specify both.
Here is a sample of VersionRecall 2023 using a registry key:
Please note that here we use a file path instead of a URL. If you are in a closed-off environment and you stage your applications on a server, you can specify any standard path with a drive letter or a UNC name here instead of an http(s) link.
The registry key is interpreted in one of two ways. If the key exists, it is opened, and the default value is assumed to contain the path to a file. If the registry key does not exist, the last part of the key path is interpreted as a value name.
Using a registry key may be a better option if your installers allow the user to select individual locations rather than having a standard ‘Program Files’ setting.
How would this path get to the registry in the first place? To make it easier for this and other tools to find your application’s install path, it could write its own location to the registry each time it starts—this way, it is always up-to-date. I would always recommend using HKEY_CURRENT_USER for this purpose. If you are on a server shared by many, or any computer that others use, it is probably best to keep this setting specific to a particular user.
Deploy Ribbon Tab
The Deploy ribbon tab in PrimalScript and PowerShell Studio have a new Web Installer section with buttons for this new feature. Once set up, you can build and run it right from here:
Web Installer – Data Location
The data for this tool and all downloads are kept here:
You will find a ‘Downloads’ folder and an ‘Installed’ folder. The ‘Downloads’ folder is where files are downloaded to and installed from. Then the files are moved to the ‘Installed’ folder, where they are kept to support uninstalling the associated application.
Web Installer – Light/Dark Mode
Last but not least, click on the sunshine icon to switch to light mode and on the moon icon to toggle back to dark mode.
There is, of course, a long list of enhancements and customization options that can be added. Please let us know in the comments what you think of this new ability and what options you would like to see. If comments are closed, please post in our support forums.