To create a deployment project 1. On the File menu, point to Add, and then click New Project. 2. In the Add New Project dialog box, in the Project Types pane, open the Other Project Types node, click Setup and Deployment Projects, then click Setup Project in the Templates pane. In the Name box, type My Notepad Installer. 3. Click OK to close the dialog box. The project is added to Solution Explorer, and the File System Editor opens. 4. Select the My Notepad Installer project in Solution Explorer. In the Properties window, select the ProductName property and type My Notepad. Note The ProductName property specifies the name that will be displayed for the application in folder names and in the Add/Remove Programs dialog box. To add the Windows-based application to the installer 1. Select the My Notepad Installer project in Solution Explorer. In the File System Editor, select the Application Folder node. 2. On the Action menu, point to Add, and then click Project Output. 3. In the Add Project Output Group dialog box, choose My Notepad from the Project drop-down list. 4. Select the Primary Output group from the list. In the Configuration box, select (Active). Click OK to close the dialog box. 5. On the Build menu, choose Build My Notepad Installer. To deploy the application (basic installer) Select the My Notepad Installer project in Solution Explorer. On the Project menu, choose Install. This will run the installer (Setup Wizard) and install My Notepad on your development computer. Note You must have install permissions on the computer in order to run the installer. Optional Deployment Capabilities This step demonstrates optional deployment capabilities; it creates a shortcut to your application that will be placed on the desktop of a target computer during installation. To create shortcuts for the Windows-based application 1. Select the My Notepad Installer project in Solution Explorer. 2. In the File System Editor, select the Primary output from My Notepad node. 3. On the Action menu, choose Create Shortcut to Primary Output from My Notepad. This will add a node called Shortcut to Primary output from My Notepad. 4. Rename the shortcut Shortcut to My Notepad. 5. Select Shortcut to My Notepad and drag it to the User's Desktop folder in the left pane. Creating a File Association This step adds a file association for My Notepad so that double-clicking .vbn files open the My Notepad application. Adding Launch Conditions This step checks to see if Internet Explorer 5.0 or higher is installed on a target computer, and it halts installation if the file is not installed. To add a launch condition to check the Internet Explorer version 1. Select the My Notepad Installer project in Solution Explorer. On the View menu, point to Editor, and then click Launch Conditions. Note This step is intended only to demonstrate the concept of launch conditions; the My Notepad application has no actual dependency on Internet Explorer. 2. In the Launch Conditions Editor, select the Requirements on Target Machine node. 3. On the Action menu, choose Add File Launch Condition. A Search for File1 node is added beneath the Search Target Machine node, and a Condition1 node is added beneath the Launch Conditions node. 4. Rename Search for File1 to Search for Internet Explorer. 5. In the Properties window, set the FileName property to Iexplore.exe, the Folder property to [ProgramFilesFolder], the Depth property to 2, and the MinVersion property to 5.00. 6. Select the Condition1 node. 7. Set the Message property to the following: This program requires Microsoft Internet Explorer 5.0 or higher. Please install Internet Explorer and rerun the Notepad installer. Setting Properties for Prerequisite Components This step sets a property to install the .NET Framework automatically if the correct version is not present on the target computer. Note that the .NET Framework 2.0 package will also install the Windows Installer 2.0 files. When the prerequisites properties are set as follows, clicking setup.exe will automatically install .NET Framework before running the .msi file (this is set by default). For more information on specifying prerequisites, see Prerequisites Dialog Box. To set optional properties for the deployment project 1. Select the My Notepad Installer project in Solution Explorer. On the View menu, choose Property Pages. 2. In the My Notepad Installer Property Pages dialog box, in Installation URL, specify the URL of a server or Web site from which the application and/or prerequisites will be installed. Click the Prerequisites button. 3. In the Prerequisites dialog box, under Choose which prerequisites to install, make sure that .NET Framework is selected (it should be selected by default). Under Specify the install location for prerequisites, accept the default setting. 4. On the Build menu, select Build My Notepad Installer. Installing on Your Development Computer This step will run the installer and install My Notepad on your development computer. To install My Notepad on your development computer Select the My Notepad Installer project in Solution Explorer. On the Project menu, choose Install. Note You must have install permissions on the computer in order to run the installer. Deploying to Another Computer This step will run the installer and install My Notepad on another computer. To deploy My Notepad to another computer 1. In Windows Explorer, navigate to your project directory and find the built installer. The default path will be \Documents and Settings\yourloginname\My Documents\Visual Studio 2005\Projects\Solution Folder Name\My Notepad Installer\project configuration\My Notepad Installer.msi. (The default project configuration is either Debug or Release.) 2. Copy My Notepad Installer.msi, Setup.exe, and all other files and subdirectories in the directory to another computer. Note To install on a computer that is not on a network, copy the files to traditional media such as CD- ROM. 3. On the target computer, double-click Setup.exe to run the installer. Note You must have install permissions on the target computer in order to run the installer. Testing This step will test starting the application from a desktop shortcut and will also test uninstalling it. To test the installation 1. Verify that the shortcut is installed on the desktop and that it correctly launches the My Notepad application. 2. Uninstall the application using the Add or Remove Programs tool in Control Panel. In Add or Remove Programs, select My Notepad, then click the Remove button. Tip To uninstall from your development computer, on the Project menu, choose Uninstall. 3. The icon should be removed from the desktop and the installed application files and folders should be deleted from your computer.