Tuesday, March 22, 2011

Creating An Installation Package


Creating an Installation Package

Here I am going to explain you how to create set up for windows application using Visual Studio 2008. Steps are as follow :

1. Open the solution file of the project you created . You will add the
installation project to the existing solution.

2. Add a Setup Project to the solution with the
File =>Add Project=>New Project menu,
as shown in Figure , and click the OK button.


3. Change the Prerequisites option in the Property page to include Windows Installer 3.1 so that the application can be installed on systems where Windows Installer 3.1 is not available. Also change the output filename , as shown in Figure . Then click OK.
Setup1=> Right click => Property



Click prerequisites



4. Using the Properties window, set the setup project properties to the values in the following :
Author: IT Martial press
Description: About application
Keywords: IT Martial , Maneesh
Manufacturer: It Martial Press
Manufacturer URL: www.itmartial.blogspot.com
Product Name: Application name
Support URL: www.itmartial.blogspot.com
Title : Installation Demo
Version:1.00.1

5. Add the primary output of the Setup project to the Application folder of the installer project using the
Project =>Add => Project Output menu options.
In the Add Project Output Group dialog, select Primary Output, as shown in Figure

.

Click the OK button to add the primary output of the project to the Application folder in the automatically opened File System Editor. In this case, the primary output is application.exe .

6. Additional files to add are a logo, a license, and a ReadMe file. In the File System Editor, create a subdirectory named Setup in the Application folder. You can do this by selecting the Application folder and then choosing the menu options Action Add Folder.

The Action menu in Visual Studio is available only if you select items in the setup editors. If an item in the Solution Explorer or Class View is selected, the Action menu is not available.

7. Add the files logo.bmp , setuplogo.bmp , readme.rtf , and license.rtf to the folder setup by right - clicking on the Setup folder and selecting Add File. You can easily create them yourself. You can fill the text files with license and ReadMe information. It is not necessary to change the properties of these files, which will be used in the dialogs of the installation program. The bitmap setuplogo.bmp should be sized 500 pixels wide and 70 pixels high. The left 420 pixels of the bitmap should only have a background graphic because the text of the installation dialogs will cover this range.

8. Add the file readme.txt to the Application folder. You want this file to be available for users to read before the installation is started. Set the property PackageAs to vsdpaLoose so that this file is not compressed into the Installer package. Set the ReadOnly property to true so this
file can ’ t be changed. The project now includes two ReadMe files, readme.txt and readme.rtf . The file readme.txt can be read by the user installing the application before the installation is
started. The file readme.rtf provides some information in the installation dialogs.

9. To make the program available from the Start Programs menu, you need a shortcut to the application program. Select Primary Output from application item in the Application folder and open the menu
Action Create Shortcut to Primary output from application. Set the Name property of the generated shortcut to name of application, and drag and drop this shortcut to the User ’ s Programs menu.

10. Start the File Types Editor with View Editor File Types. Add a new file type using the menu Action Add File Type, with the properties set as shown in the following :.

(Name):.ext
Command : Primary output
Description: Description of extention
Extensions: .ext
You can also set the Icon property to define an icon for the opening of files, and a MIME type. Leave the properties of the Open action with the default values so that the filename is passed as an application argument.

11. Start the User Interface Editor by selecting View Editor User Interface.
12. Use the User Interface Editor to set properties for predefined dialog boxes. Figure shows the automatically generated dialogs and two installation modes that you should see.



13. Select the Welcome dialog. In the Properties window, you can see three properties for this dialog: BannerBitmap , CopyrightWarning , and WelcomeText . Select the BannerBitmap property by clicking Browse in the combo box, and select the wroxsetuplogo.bmp file in the
folder Application Folder\Setup . The bitmap stored in this file will appear on top of this dialog.
The default text for the property CopyrightWarning is as follows:
WARNING: This computer program is protected by copyright law and international
treaties. Unauthorized duplication or distribution of this program, or any
portion of it, may result in severe civil or criminal penalties, and will be prosecuted to the maximum extent possible under the law.
This text appears in the Welcome dialog also. Change this text if you want a stronger warning. The WelcomeText property defines more text that is displayed in the dialog. Its default value
is as follows:
The installer will guide you through the steps required to install
[ProductName] on your computer.
You can change this text too. The string [ProductName] will be automatically replaced with the property ProductName that you defined in the properties of the project.

14. Select the Installation Folder dialog. This dialog has just two properties: BannerBitmap and InstallAllUsersVisible . The latter property has a default value of true . If this value is set to false , then the application can only be installed for the user who is logged on while the installation is running. Change the value of BannerBitmap to the logo.bmp file, as you did with the Welcome dialog. As each dialog can display a bitmap with this property, change the BannerBitmap property for all the other dialogs too.

15. Add a Read Me and a License Agreement dialog to the Start sequence by selecting Action Add Dialog. Define the order in the start sequence by dragging and dropping as follows:
Welcome – Read Me – License Agreement – InstallationFolder – Confirm Installation .

16. Configure the BannerBitmap property for all these dialogs as you did earlier. For the Read Me dialog, set the ReadmeFile property to readme.rtf , the file you added earlier to
Application Folder\Setup .

17. For the License Agreement dialog, set the LicenseFile property to license.rtf .

18. To create the Microsoft Installer Package, right - click the Setup project and select Build.

19. With a successful build you will find the files setup.exe and application.msi as well as a readme.txt file in the Debug or Release directory (depending on your build settings).

Now you can start installing the application by double - clicking the Setup.exe file

Twitter Delicious Facebook Digg Stumbleupon Favorites More

 
Design by Free WordPress Themes | Bloggerized by Lasantha - Premium Blogger Themes | Affiliate Network Reviews