Sunday, December 18, 2011

14-Tutorial 14: Making A Setup or Deployment Package of a Microsoft Windows Program in C++ By Russell Pitts

Tutorial 14: Making A Setup or Deployment Package of a Microsoft Windows  Program in C++ By Russell Pitts  
        Bring up the project you are working on as a Microsoft Windows Form Application which you wish to distribute.   Here for the sake of simplicity I will use a simple project that has a button on it and a label called “HelloWorld”.  If the button is clicked a message appears in the label that says hello.  It looks as follows: 
Sample Program for Deployment
        On the button is the simple code:
private: System::Void button1_Click(System::Object^  sender, System::EventArgs^  e)                    {
                         label1->Text="Hello!";
                   }
        Rebuild the Project so the project and its files are saved.  Now go to File>New Project>Other Project types>Setup and Deployment>Setup Wizard  as shown in the following figure:
Setting up the project
        Under Solution, select “Add to Solution” and then enter OK.    In the setup Wizard, 1 of 5, that follows enter Next...
Welcome to the Setup Project Wizard
        In the next window, 2 of 5, go with the default and select Next:
Choose a Project type
        In the next window, 3 of 5, select Primary output from HelloWorld and Resource Satellite DLL's from HelloWorld and select Finish.
Choose project ouputs to include
        Open the Solution explorer for the project and right click on Setup1 and select build as is shown in the following figure:
Build Menu
        Navigate in Windows Explorer to the debug folder of Setup1 of your  HelloWorld Project as illustrated in the following figure and copy the entire debug folder
Explorer Window of Project
         Then paste the debug folder someplace else and change the name of the debug folder to Setup.  These two files Setup1.msi and setup.exe in this folder are all you need to install the package.
Explorer Window
 (Back) 

0 comments:

Post a Comment