Packager 1

1: New Installation Deployment Project
Open VS, click New Project, select: Other Project Types -> Installation and Deployment -> Setup Wizard (installation project, too), and then click OK (see below in detail).
Picture this topic are as follows:


2: Setup Wizard
after you close the installation wizard opens, click Next, or click Finish.


3: Start making
the installation wizard to complete the project to enter the file folder:
Double-click the " Applications folder " right-click the blank space on the right, select Add -> file, add in the executable file of your application and make the appropriate libraries and components.



Then right-click your executable file, create a shortcut, and then were cut or copy the shortcut to the left of "user 'Program' menu" and "user desktop" in.
So after installing the program installation will be completed in the " start - shortcut to the program is generated on> All programs "and" Desktop. "


Then right-click on the left of the "Application Folder" to open the Properties dialog box:

The attribute " DefaultLocation path" in "[manufacturer]" removed,
otherwise good installer will default installation directory is "c: \ programm file \ your user name \ install solution name ";

and then open the solution Explorer, right-click your solution name and choose properties:


in the property page that opens, select the" Prerequisites "




在打开的系统必备页中,选中如下中的选择项,这个很重要!!!!!1!!!!!
选上以后,在生成的安装文件包中包含.netframework组件.(这个选项默认是没有选中的)



好了,这样就完成99%了,然后点击"生成->生成解决方案",哈,生成成功!
4:制作完成
现在打开解决方案文件夹下的debug文件夹,就可以看到生成的安装文件了.



【续】关于"卸载"功能的添加
上面的文章只介绍了简单的生成安装的方法,
但是在vs.net2005下并没有直接生成卸载程序的功能,
所以我们只好用msi来实现了,
原理我就不讲了,网上一搜一堆,我只讲操作,
【1】:在添加你的应用程序项目的时候,多添加一个msiexec.exe进去,
这个文件在c:\windows\system32文件夹下,


添加进去以后,为了让他更像个卸载程序,把他的名字改成"Uninstall.exe",



当然这个关系不大,改不改都行的.
然后给他创建一个快捷方式,放到桌面或者"开始-程序"中,
我选择放在了开始菜单中,然后下面我们要的做的就是查找这个部署项目的ProductCode了,
鼠标左键单击项目名称,记住是左键单击,然后点击属性标签,注意:不是右击的属性,
这个区别很大,这时你就可以看到ProductCode了,



然后打开你创建的那个快捷方式的属性对话框,
在Aguements属性中输入"/x {ProductCode}",





好了,然后点击"生成解决方案"即可生成带有卸载功能的安装程序了.

Guess you like

Origin www.cnblogs.com/qiu18359243869/p/11073946.html