Make VDProj .MSI installer copy itself locally after successful install

六眼飞鱼酱① 提交于 2019-12-13 17:19:35

问题


We have large C# application spanning many projects which is packaged into an .MSI file by running MSBuild (or through Visual Studio 2010) on a .VDProj file. The installation usually works fine, and warns correctly if other required software is not found on the local machine.

However, if the installation is successful, we would like the installer to copy itself to some particular folder in program files. For example 'c:\program files\app\version\install_1.2.3.4.msi'.

Does anyone know of any way of doing this?


回答1:


You can get the MSI path from OriginalDatabase property. To copy the MSI you can use a custom action scheduled after InstallFinalize standard action.

For example, you can write a simple EXE which receives [OriginalDatabase] as a parameter and performs the copy operation.

InstallFinalize is not shown in Visual Studio. You can add your custom action under Install and edit the MSI with ORCA to change its sequence after InstallFinalize in InstallExecuteSequence table.

You can get more control over custom actions by using other setup authoring tools.



来源:https://stackoverflow.com/questions/5091174/make-vdproj-msi-installer-copy-itself-locally-after-successful-install

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!