Create Setup and Deployment Of Wpf Application Step By Step with Visual Studio 2012
In one of my old posts I have explained step by step for creating installer file using Visual Studio 2010.
In this post we will see the same but with Visual Studio 2012.
Create your WPF application and then add a New Project to your solution.
Select Other Project Types à Setup and Deployment
Select the one and only template “Enable InstallShield Limited Edition”
You will be navigated to a page where you need to install the InstallShield software.
Click on the “Go to the download web site.”
You would be navigated to Flexera Software website page. Here you need to fill up the mandatory details to download the software.
Click on “Download Now” button to start the download.
Your download will be started. Wait a while, while your download completes.
Install the InstallShiled 2012 Spring Limited Edition. Click next to proceed and accept the EULA to install.
You have successfully installed the InstallShield 2012 Spring Limited Edition.
You need to add the setup project to your solution once again.
This time you would be asked for “InstalleShield Time-liomited Trial”.
Note that; you would be sent a License Key for your download to your related E-mail Id.
Choose based on your license key.
The product would be activated if you provide one; else you would be in trial mode.
As soon as the Setup project is created you are in home page as “Project Assistant”.
Also you can see the Setup project in your Solution.
Click on “Application Information”
Enter setup and application related information.
You can set the followings:
- Company Name
- Application Name
- Application Version
- Company Website
- Application Icon
Click on “Installation Requirements”
Here you can provide information about your installation requirements specific to Operation System or/and previously installed applications (software).
In this sample I have selected “Yes” option for Specific Operating System.
And I have selected, Windows 8 and Windows 7 as Operating Systems.
Also I have selected “Yes” for Any Software to be installed on the machine.
I have selected “Microsoft .NET Framework 4.0 Client package”
Click on “Installation Architecture”
This particular tab is disabled in Lite Edition.
All the options in this tab are disabled.
Click on the tab “Application Files”.
Click on “Add project outputs”
A dialog with options are displayed.
Select Content Files (If you have any content files), and Primary Output (Mandatory).
Click OK to add.
The following image shows that you have added the Content Files and Primary output to the Program Files folder.
Note that the destination is set to “INSTALLDIR”
This is not an optional step.
Please do a build of your setup project.
Before that you need to check the Project Build order. It should be your WPF application project first (not necessarily if you have dependency on other project) and the setup project at last.
You can change the dependency tab to change the order.
Now do a build of your setup project.
In case you are getting any error, try to build the WPF project first and then the setup project. Try to fix errors if any.
Click on “Application Shortcuts”
Click on Create an uninstallation shortcut.
Create by clicking on the “New” button.
Select “ProgramFilesFolder” and click on Open.
Select “<Company Name>” and click on Open.
Select “<Program Name>” and click on Open.
Select “Primary Output” and click on Open.
The shortcut would be added as Built.
Click rename to rename the shortcut.
You can choose the option (optional) “Create shortcut on desktop” here.
If you need to add more shortcuts, you can click on Shortcuts link.
This is also an important step where you to select the Working Directory for your shortcut.
For Start Menu shortcut
For Desktop shortcut
You can add a new shortcut by selecting the target folder and right click on it. And select “New Shortcut”.
Browse for the Primary Output as described in step 19. Click open to add.
Change the working directory.
Click on “Application Registry”
If you have any registry add/update to make you can do it here.
Click on “Installation Interview”
This is the final steps to have options on your installer.
You can have following options such as:
- EULA (End User License Agreement)
- Prompt User for Company Name and User Name
- Modify option for installation location
- Launch application on installation completion
If you opt for “Launch application on installation completion”; you need to browse for the Primary Output once again here.
After selecting the Primary Output, it would look like following.
Now remember that you are in debug mode; and you have option to Install/Uninstall directly from here.
To have a distribution copy; you need to choose Release.
Then build the setup project.
Select InstallShield LE menu and select “Open Release Folder”
Your target folder is opened here. You could rename it and distribute.
Remember to test it once again before distribution.
Hope this article helps. Thanks for reading.
Please like me in Facebook.