Visual Studio Pro 2012 Install Shield LE

Posted on Thursday, February 14, 2013




This guide will go over how to install and use InstallShield LE in Visual Studio Pro 2012.

  

But first!


But first I am going to write a simple Hello World C# program in Visual Studio Pro, so that I have something to put into an installer.


Hello World C#


The first hello world example I found is on youtube at  http://youtu.be/DF2fCWLFSG0  [1]



Open Visual Studio 2012 and click on File --> New -->  Project




Select Templates --> Visual C#  -->  Windows

Then select "Windows Forms Application"  then set the .Net Framework to 4.0  (It was released April 2010)

Enter a name for the project.  In this case name it HelloWorld.
Click Browse and find a folder to save this project to.





Click OK

Now the project will be created.




In the Toolbox under the All Windows Forms select Button.





Double click in the Form1 Window to add a button






Select the button then look in the lower right at the properties and select the "Text" field






Update the text to "Hello World"





This will update the buttons text


Double click on the button to open up the Code window Associated with the button (events)






This piece of code button1_click is an event listener.  When the button is clicked it will execute the code.

In this case I added a MessageBox.Show("Hello World")








Click on the Start program to compile and run this program






The program starts up!

Click on the Hello World Button





And a Hello World Message Box Appears.

Close the MessageBox and the Form1 Window to get back to Visual Studio.




Avoiding an Installer Error



During the creation of an installer I ran across this error
"Cannot extract icon with index 0"

This error was caused by the fact that my program did not have an icon associated with it.  So as to avoid this problem when creating the installer I will add an icon to my HelloWorld Program.

First you need a .ico image file.  If you are unsure how to convert an image file to a .ico image file you can use this web site to do it for you  http://image.online-convert.com/convert-to-ico







Click on Choose file to upload an image you have on your computer.  Then set the pixel size and click convert.  The results will automatically download to your computer.

In my case I did not even set a pixel size I just converted a large image file.






Click on Project -->  HelloWorld Properties






Click on the Browse for an icon button






Select the .ico image file and click Open





A tiny image should appear here.


Save your project.



InstallShield LE


First we need to set up InstallShield LE from within Visual Studio 2012




Click on File --> New -->  Project





Click On Templates --> Other Project Types --> Setup and Deployment

Then double click on Enable InstallShield Limited Edition






This will open up a local file as a web page.  Click on the "go to the download web site"






Fill out the information and click Download Now.







A new web page opens and an email is sent to you.

Click on Download Now.






Click on Run





Click Run again





Click Next





Accept License and click next





Click Install






Wait as it installs….






Click Finish


Restart Visual Studio Pro 2012.


After Visual Studio restarts....




Click on File --> New -->  Project









Click On Templates --> Other Project Types --> Setup and Deployment

Then double click on Enable InstallShield Limited Edition





 Select Activate or Register and click next




Enter the serial code that was emailed to you and click Activate





Wait while it activates






Click Finish






Use Install Shield in a Project


The email contained a link to a 5 minute how to vide located here



As for me here is what I did….

First open up a project.  I opened up a simple Hello World Program I had made prior to this.





Right click on Solution --> Add -->  New Project






Select Other Project Types -->  Setup and Deployment

Select Install Shield Limited Edition.

Give the Project a name and click OK






Use the Project Assistant to help you (it appears in the main screen in visual studio)

Click on Application Information








Enter the Company name,  The application name,  The version and the company web site.


Click Browse and find the .ico file image file






Click on Browse again and search for the .ico file






Select the .ico file and click Open

Click OK







Click on Installation Requirements


Here you can set up requirements that must be present for this program to run.   For now I will leave it as is.  But if you need to require it has word 2003 you can.





Click on Application Files





Click  on Add Project outputs







Select Primary Output and click OK






Right  click on the Project and click Resolve Project Output





Click OK








Click on Application Shortcuts






Click New





Open ProgramFilesFolder






Open My Company Name






Open My Application Name







Select the output and click Open







Change the name of Built to what you want the application to be called.






I changed the name to HelloWorld.   I also checkboxed the "Create Shortcut on Desktop"

Now build the solution






Build the Solution




Click on Build -->  Build Solution



Go the folder with the installer build,  In my case it is at
 C:\Users\patman\Desktop\HelloWorld\HelloWorld\HelloWorld_Installer\HelloWorld_Installer\Express\DVD-5\DiskImages\DISK1




Now double click on the setup.exe and go through the installation process.





When it finishes you will see the program in the Start Menu




As well as a shortcut on the desktop
           






References
[1]        How to create a simple calculator by using Visual Studio 2012 HD   
            http://youtu.be/DF2fCWLFSG0
                Accessed 02/2013
[2]        InstallShield LE how to            
                Accessed 02/2013 

2 comments:

  1. Hello, pretty clear example, but I have a doubt
    . 1 - Why not generate a folder where all the installation files are saved?. It is a facility like other programs that save files in a folder on the C: \ drive ...
    I await your response. thanks

    ReplyDelete