设置项目 msi 构建+声称安装成功,但没有输出
根据标题,我创建了一个 msi 安装程序,然后运行它,它声称已成功安装,如果我在控制面板中查看以添加/删除程序,它就会出现在那里。但是,当我查看我指定的目录时,没有对其进行任何更改。没有任何内容被复制到其中。
当我运行安装程序并单击按钮创建新目录并选择要安装到的新目录时,我没有收到任何错误。一切运行正常,但退出安装程序后,不会创建这个新目录。
我按照以下步骤创建我的 msi 安装程序:
打开 Visual Studio 并打开我希望为其创建安装程序的项目
文件->添加->新项目->设置向导
选择“为 Windows 应用程序创建设置”
选择“来自(项目)的主要输出”
添加附加文件 -> txt 文件的路径
完成设置向导
查看应用程序文件夹进行设置
右键单击(项目)的主要输出
单击输出并验证其是否正确
构建安装项目
这会输出 .msi文件与 .exe 文件一起。运行其中任何一个都没有问题/错误。它只是不安装/复制文件。
As per the title, I create a msi installer and then run it and it claims to have successfully installed and if I look in the control panel to add/remove program it appears there. However, when I look in the directory I specified, there is no change made to it. Nothing is copied into it.
When I run the installer and click the button to create a new directory and choose that new directory to install into, I get no errors. It all runs fine, but after exiting the installer, this new directory is not created.
I follow these steps to create my msi installer:
Open Visual Studio and open the project I wish to create installer for
File-> Add -> New Project -> Setup Wizard
Select "Create a setup for Windows Application"
Select "Primary output from (project)"
Add additional file -> path to txt file
Finish setup wizard
Look at Application Folder for setup
Right click primary output from (project)
Click outputs and verify it is correct
Build the setup project
This outputs the .msi file along with the .exe file. There is no problems/errors running either of these. It just doesn't install/copy the files.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
好的,这是双击 .msi 文件时的权限问题。
它可以正常运行并声称安装成功,但它没有创建文件夹/复制内容等。它需要管理员权限才能安装。
因此,为了赋予它权限,我编辑了创建 .msi 文件的 .vdproj 文件(在记事本中编辑)。我转到 MsiBootstrapper 部分并将“RequiresElevation”=“11:FALSE”更改为“RequiresElevation”=“11:TRUE”。
更多信息可以在这里找到:http://msdn.microsoft.com/en-us/library/2kt85ked.aspx
我对此仍然不太满意,它需要双击 .exe 文件,这会提示 UAC 使 .msi 文件以所需的权限运行。对于用户来说,只需双击 .msi 文件并相信已经安装的东西似乎很容易......
Ok, so it was a privileges issue when double clicking the .msi file.
It would run fine and claim to install successfully but it didn't create folders/copy stuff in etc. It needed admin privileges to install.
So, to give it the privileges I edited the .vdproj file that created the .msi file (edited in notepad). I went to the MsiBootstrapper section and changed "RequiresElevation" = "11:FALSE" to "RequiresElevation" = "11:TRUE".
More information can be found here: http://msdn.microsoft.com/en-us/library/2kt85ked.aspx
I'm still not completely happy with this, it requires double clicking the .exe file which gives the UAC prompt to get the .msi file to run with the required privileges. It seems very easy for a user to just double click the .msi file and believe things to have installed...