Getting Started With WIX (Windows Installer XML) in VS2012
Referred URL
http://www.c-sharpcorner.com/UploadFile/cb88b2/getting-started-with-wix-windows-installer-xml-in-vs2012/
Introduction
The Windows Installer XML (WiX) is a toolset that builds Windows installation packages from XML source code. The toolset supports a command line environment that developers may integrate into their build processes to build MSI and MSM setup packages.
Advantages
The WiX toolset provides the following advantages over other popular Windows Installer developer tools:
The Windows Installer XML (WiX) is a toolset that builds Windows installation packages from XML source code. The toolset supports a command line environment that developers may integrate into their build processes to build MSI and MSM setup packages.
Advantages
The WiX toolset provides the following advantages over other popular Windows Installer developer tools:
- WiX offers unrestricted access to Windows Installer functionality.
- It leverages XML-based source files, that can easily be edited in any text editor and are easily version controlled.
- The command-line interface allows WiX to be integrated into any automated application build process or continuous integration environment.
- There is no need to get expensive licenses for special tools. The WiX toolset is free.
Download
To download WIX visit the link http://wixtoolset.org/ .
After Installing (WIX) we have Wix Template In Vs2012
To create a setup of an application we need to do the following:
To download WIX visit the link http://wixtoolset.org/ .
After Installing (WIX) we have Wix Template In Vs2012
To create a setup of an application we need to do the following:
- Create a WPF application project in the solution.
- Create a new Wix project solution.
- Add a reference to the WPF Application into the WIX project.
- Configure the installation XML (*.WXS) file using the following procedure:
o Add the WPF project to the *WXS File
o Add the Cab1.cab File to the Package.
o Create a folder in Program Files and Folders
o Create a folder in the Program Menu for Program menu shortcut
o Create a folder on the Desktop
Step 1: Add new WPF Application
Use "New" -> "Project..." ->"WPF Application project".
It will look like this:
Step 2 : Add Windows Installer Project
Now it will look like:
Step 3: Add a reference of the WPF Application
Right-click on the reference of the of the WIX project and add the WPF Project.
Step 4: Configure the installation of the XML file (*.WXS)
While you see the *.wxs file it has some predefined code written in XML. It has various properties and tags for these things, you need to the following:
Use "New" -> "Project..." ->"WPF Application project".
It will look like this:
Step 2 : Add Windows Installer Project
Now it will look like:
Step 3: Add a reference of the WPF Application
Right-click on the reference of the of the WIX project and add the WPF Project.
Step 4: Configure the installation of the XML file (*.WXS)
While you see the *.wxs file it has some predefined code written in XML. It has various properties and tags for these things, you need to the following:
It will explain all the properties in detail and you can get a practical example from here.
Note: You must provide the new GUID where I have "Your-Guid-". You can do that very easily from Visual Studio.
Click on "Tools" and click on "Create GUID"; it creates a new GUID every time.
Use the new GUID by just clicking on the "Copy" button and paste it wherever you want the GUID.
Add WPF project to the *.WXS File
We need to give a reference of the WPF Application project in the *.WXS file. So that we can use the variables of the WIX you can see this on the link and in: http://wix.sourceforge.net/manual-wix3/votive_project_references.htm. I have done that like this:
Add Cab1.cab File inside the Package
When you build you WIX project it will create a Cab1.cab file and a *.setup so if we need only one single file for the setup add that time we need to add that file to our setup file.
Create Folder in Program Files Folders
Create Folder in Program Menu for Program menu shortcut
In the start menu we can create a folder and inside the folder we can provide our application. To do that we need to do 3 steps.
Step 1: Create Program Menu Folder
It will create a folder named "My System Pvt Ltd " in the Start Menu.
Step 2: Add shortcut of our application with image
You can use any *.ico file ,add that file to the WIX project.
Step 3: Add shortcut component to Features
We are telling you that you need to add this shortcut to the installer.
Create shortcut on Desktop
If you need to add a shortcut to the Desktop then we need to use the same steps as we did for creating the shortcut in the Startup Menu or Program Menu.
Step 1: Create Desktop Folder
Step 2: Add shortcut of our application with image
Step 3: Add shortcut component to Features
Add the Application to the Startup Folder (When the user is logged into the application it starts automatically)
If you want to put your application in the Startup folder then you can do that as you have done for the Program Menu shortcut and Desktop shortcut.
Step 1: Create Startup Folder
Step 2: Add shortcut of our application with an image
Step 3: Add shortcut component to Features
Note: You must provide the new GUID where I have "Your-Guid-". You can do that very easily from Visual Studio.
Click on "Tools" and click on "Create GUID"; it creates a new GUID every time.
Use the new GUID by just clicking on the "Copy" button and paste it wherever you want the GUID.
Add WPF project to the *.WXS File
We need to give a reference of the WPF Application project in the *.WXS file. So that we can use the variables of the WIX you can see this on the link and in: http://wix.sourceforge.net/manual-wix3/votive_project_references.htm. I have done that like this:
Add Cab1.cab File inside the Package
When you build you WIX project it will create a Cab1.cab file and a *.setup so if we need only one single file for the setup add that time we need to add that file to our setup file.
Create Folder in Program Files Folders
Create Folder in Program Menu for Program menu shortcut
In the start menu we can create a folder and inside the folder we can provide our application. To do that we need to do 3 steps.
Step 1: Create Program Menu Folder
It will create a folder named "My System Pvt Ltd " in the Start Menu.
Step 2: Add shortcut of our application with image
You can use any *.ico file ,add that file to the WIX project.
Step 3: Add shortcut component to Features
We are telling you that you need to add this shortcut to the installer.
Create shortcut on Desktop
If you need to add a shortcut to the Desktop then we need to use the same steps as we did for creating the shortcut in the Startup Menu or Program Menu.
Step 1: Create Desktop Folder
Step 2: Add shortcut of our application with image
Step 3: Add shortcut component to Features
Add the Application to the Startup Folder (When the user is logged into the application it starts automatically)
If you want to put your application in the Startup folder then you can do that as you have done for the Program Menu shortcut and Desktop shortcut.
Step 1: Create Startup Folder
Step 2: Add shortcut of our application with an image
Step 3: Add shortcut component to Features
0 comments