After describing philosophy behind constructing SharpSetup and its main concepts now it is time to show that SharpSetup is software that really works. While there is no publicly downloadable version of SharpSetup yet, this article shows a few screenshots of SharpSetup and constitutes a quick start guide for new SharpSetup users.
To use SharpSetup you will need the following software installed on your computer:
- modern Microsoft Windows operating system that is MS Windows XP or later (SharpSetup generated installers will run on Windows 2000 onwards),
- Visual Studio 2008 (Visual Studio 2010 support is underway),
- Windows Installer XML (WiX) version 3.5,
- and finally, SharpSetup itself.
After installing all those components you may be surprised that there is no link to executable program in Programs group in Start menu. This is very much intended as the only way to use SharpSetup is from within Microsoft Visual Studio Integrated Development Environment. To create your first setup solution start Visual Studio and then click File -> New -> Project... menu item (or press Ctrl+Shift+N keyboard shortcut). The New Project dialog will appear. In left-hand side tree control choose Other project types -> Visual Studio Solutions. Next, choose SharpSetup Solution icon in the right-hand side part of the window. You can also choose name of your new installer as well as filesystem location for your solution files.
After clicking OK button the Installer initial configuration dialog will appear. In this dialog you can enter some basic information about your installer such as application name (in short and long form), version, author and initial installer translation language. If you don't need to translate your installer right now or you need more than one additional language don't worry - you will be able to turn off translations or add more languages later.
A few seconds after clicking OK button you will get something like:
At this point you can just build the solution by running Build Solution command from Build menu (or use F6 shortcut). The installer will be created in folder named after choosen build configuration (in our case Debug) in solution folder. Your installer will be named like the solution + exe extension (in our case Installer1.exe). Of course before distributing the installer you should change build configuration to Release.
Now, let us have a closer look at the last screenshot as it presents several important aspects of SharpSetup. First, we can see that the solution contains 5 projects: Assembler, Gui, IntermediateBootstrapper, Package and Translation. Two of those, namely Gui (also known as External UI) and Package (core MSI package) were described in the article about installer structure.The other three projects provide infrastructure for building a complete installer. Assembler project takes all necessary files and assembles them into a single executable file ready for distribution. IntermediateBootstrapper (IB for short) allows you to write C++ code executed before running main Gui. This code has minimal runtime requirements so it is perfectly suited for checking installer prerequisites. IB also contains Win32 resources that will be transferred to the final installer executable (eg. application name, version, bootstrapper translations). Translation project simplifies creation of satellite assemblies with translations of SharpSetup controls. All those projects will be described in detail in subsequent articles.
Second thing worth noting is the fact that even though SharpSetup does not provide standalone UI editor (UI designer) for creating dialogs you can use forms and controls designer built into Visual Studio. As you can see main part of every dialog can be visually edited, translated into other languages and supplemented with code just as every other control you created in your applications. The fact that setup dialogs are written in pure .NET gives you great flexibility in how you design them: you can use custom controls (either standard, developed by yourself or third-party), react to events, use inheritance to provide common look and feel, etc. Of course SharpSetup provides you with a set of template dialogs and controls that are specific to installer development.
Next articles will describe each of the 5 projects in further detail and show how they are used during installer lifecycle.
Previous in series: SharpSetup installer structure
Next in series: Installer GUI design