VS2017 Installer项目输出不会替换当前安装

编程入门 行业动态 更新时间:2024-10-26 10:36:03
本文介绍了VS2017 Installer项目输出不会替换当前安装的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我有一个标准的Windows窗体应用程序,正在使用VS2017安装程序项目进行部署.当使用文件系统"打开安装项目时,我在应用程序文件夹中添加了以下内容:

I have a standard windows forms application that is being deployed using the VS2017 setup project. When opening the setup project using the "File System", I added to the application folder the following:

  • 胜利表格应用程序的主要输出.
  • EPPlus库的dll.
  • 一些Excel文件.
  • Primary output from the win forms app.
  • The EPPlus library's dll.
  • Some excel files.
  • 安装项目可以很好地输出.msi包.问题是,当我在构建安装程序项目(当然是在构建源项目之后)之后运行.msi输出并运行该应用程序时,我看不到我的更新,即使C:\Program Files ....目录上的文件也没有被修改.我尝试更改产品代码并增加版本,但是它不起作用.我的问题是:

    The setup project gives the output .msi package just fine. The problem is, when I run the .msi output after building the setup project (of course after building the source project) and run the application, I do not see my updates, even the files on C:\Program Files .... directory are not modified. I tried changing the product code and the increasing the version and it does not work. My questions are:

  • 除了再次删除并安装程序外,是否还可以使安装程序包实际更新软件的安装?
  • 无论我更新多少软件,如何避免#1中的问题?
  • 原因是什么,以及如何避免出现此错误已安装该产品的另一个版本"?我不确定我是怎么弹出的.
  • 如果我希望源代码的某些部分位于单独的dll中,是否像添加类库项目并将其输出添加到安装项目一样简单?
  • 非常感谢您.

    推荐答案

    升级的方法是使用RemovePreviousVersions项目设置.这些步骤是:

    The way you do the upgrade is to use the RemovePreviousVersions project setting. The steps are:

  • 增加设置项目的版本并接受更改,这将包括对ProductCode的更改.
  • 确保将RemovePreviousVersions设置为true.
  • UpgradeCode(设置项目属性)必须相同,因此请勿更改.
  • 增加需要更新的二进制文件的文件版本(这是有关更新版本化二进制文件的标准规则).
  • 生成的MSI将进行重大升级(使用Windows Installer术语)并升级旧版本,将其替换为新产品MSI.请注意,升级仅适用于相同的安装环境.每个人都不会升级我只是我",因此这将导致在程序和功能"中出现两个条目.进行安装以创建详细的日志并搜索敌人的FindRelatedProducts条目将告诉您是否找到了升级. msiexec/I [msi文件的路径]/l * vx [文本日志文件的路径]

    The resulting MSI will do a major upgrade (in Windows Installer terminology) and upgrade the older version, replacing it with your new product MSI. Note that an upgrade will work only with the same context of install. An Everyone will not upgrade a Just me, so that will result in two entries in Programs and Features. Doing the install creating a verbose log and searching foe FindRelatedProducts entries will tell you if it found the upgrade or not. msiexec /I [path to msi file] /l*vx [path to a text log file]

    这里有更长的解释: www.red-gate/simple-talk/dotnet/visual-studio/updates-to-setup-projects/?_ga=2.138201520.1662048302.1514485579-1682631157.1514485579

    There's a longer explanation here: www.red-gate/simple-talk/dotnet/visual-studio/updates-to-setup-projects/?_ga=2.138201520.1662048302.1514485579-1682631157.1514485579

    这是旧的但相关的.并没有提到更新二进制文件版本的要求(早期的VS安装项目不需要).

    which is old but relevant. and doesn't mention the requirement to update binary file versions (it wasn't needed with early VS setup projects).

    更多推荐

    VS2017 Installer项目输出不会替换当前安装

    本文发布于:2023-11-06 13:25:50,感谢您对本站的认可!
    本文链接:https://www.elefans.com/category/jswz/34/1563806.html
    版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
    本文标签:项目   Installer

    发布评论

    评论列表 (有 0 条评论)
    草根站长

    >www.elefans.com

    编程频道|电子爱好者 - 技术资讯及电子产品介绍!