【问题标题】:Take backup of target dir before files are copied into the target directory by msi Installer在 msi 安装程序将文件复制到目标目录之前备份目标目录
【发布时间】:2013-07-15 12:42:37
【问题描述】:

我正在使用常规的 Visual Studio 安装项目来部署我的 ASP.NET 应用程序。我需要处理目标目录中存在现有 web.config 的情况。找到后,需要在安装之前对其进行重命名。如果这没有发生,新的 web.config 将不会覆盖旧的。 在复制正在安装的文件之前,如何获得我的自定义操作来重命名旧的 web.config? 到目前为止,我已经尝试从 System.Configuration.Install.Installer 派生并覆盖 OnBeforeInstall、Install 和 Commit。似乎所有这些方法都是在将新文​​件复制到目标目录之后发生的。

【问题讨论】:

    标签: asp.net installation windows-installer


    【解决方案1】:

    我自己找到了解决方案!

    您必须编辑 WebDeploy 项目右键单击并打开项目文件。并且其扩展名必须是 .wdproj。

    添加这些属性组

    <PropertyGroup>
    <TransformWebConfigEnabled>False</TransformWebConfigEnabled>    <AutoParameterizationWebConfigConnectionStrings>False</AutoParameterizationWebConfigConnectionStrings>
    <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
      </PropertyGroup>
    

    如需更多帮助,您可以点击链接。

    [1]:Can't rename MSI afterwards

    并寻求帮助:

    [2]:https://www.simple-talk.com/dotnet/visual-studio/updates-to-setup-projects/

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-01-14
      • 1970-01-01
      • 2017-11-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-03-22
      • 1970-01-01
      相关资源
      最近更新 更多