Create a Windows Installer "MSI" using WiX part1
- Visual Studio
- Visual Studio Community 2017
- Visual Studio Community 2019
- WiX Toolset
※ Works in other versions, but is unconfirmed
Last time I set up WiX, I'd like to actually create an installer.
Image of installer to create
If you create it in this step, you will be able to create the following installer.
- You have already created an application for Windows that you want to publish.
- WiX is set up.
Preparing for programs (exes) to distribute
Create a program, build, and prepare the application (exe) that has completed the test. We've used WiX to distribute a trial version of the game little saber,so we've posted the steps. Please note that some games include graphics.
Below is a list of the files to be installed this time. Since "exe" and "ico" are files for games, "exe" if you want to work alone "exe" is not a problem. "ico" is an icon image to be displayed in the start menu, so you should prepare.
By the way, the program has 32bit and 64bit versions, but this time i'll create a 32-bit installer.
Create a WiX setup project
Start Visual Studio and create a new project. Select it because there is Setup Project for WiX v3.
The name of the project should be easy to understand. You can find it anywhere, but if you don't have any trouble, you can pass an alphanumeric path.
The project has been created. You will be writing the settings required for the first "Product.wxs" opening, but first you will prepare for it.
Browse ui libraries
Depending on what installer you create, i'd like to make some changes to the simple wizard-style installer, so I'll add a library of UI. Right-click References in the project and select Add Reference.
Open the folder "C:\Program Files (x86)\WiX Toolset v3.11\bin\", add "WixUIExtension" and click the OK button. (The path of the folder may vary depending on the development environment and wix version.)
Has been added.
Right-click the project and select Properties.
From the Installer tab, you can specify the file name of the installer to generate with Output name. You can change the file name even after you generate the installer, so change it as needed.
Select the Build tab. I don't think i'll release it with debug configuration, so I'm going to change the Configuration to Release.
Enter ja-JP for Cultures to build. It seems to be able to specify multiple languages or unfilled, but if you build in a language other than ja-JP in the Japanese OS environment, you will get an error. If you want to build in another language, you may need to provide an English OS or add a language package. (Unconfirmed operation)
Provide the material to display in the wizard
I'll prepare three materials to display the installer wizard.
It appears in the banner at the top of the installation screen.
The size of banner.bmp is 493 x 58 pixel. It is usually preferable to fit the image within 200px on the right and make the remaining background white, but you can also put the image on the left. In that case, it overlaps with the text, so it should not be hard to see.
Used for background images at the start and end of the installation.
dialog.bmp is the size of 493 x 312 pixel. If you want to fit the image on the left, fit it in the range of "164 x 312" pixel, and make the rest a white background. If you put an image on the right side, it will overlap with the text, so it should not be hard to see.
Used to display the license agreement on the installation screen. The contents created in this file are displayed as it is on the installation screen. Not to mention sentences, layout and text decoration are reflected.
There is no fixed text to display, so please create the content for the application you want to distribute.
You can edit the .rtf file in WordPad, which is standardly installed on Windows. You can edit word, but it's safe to edit it in WordPad because you remember it didn't look good.
Add these three files to your project.
Deploy the files to install
Create a folder in the project folder. The folder name can be anything, but making it a little easier to do so if you want to do the same folder name that you create in Program Files during installation. This folder name is also used for relative paths when referring to files in a configuration file.
You have a folder in a project folder, but you don't need to add it to your Visual Studio project.
Add a set of files to install.
At this point, you're ready to go to the stages before you set up the installer. Next time, I'll show you how to set up the installer and how to get it done.