我目前正在 Visual Studio 2015 中使用安装项目。它运行良好,但我遇到了特殊需要的问题。安装程序完成后,我需要运行在我的应用程序上注册我的服务器的 .js 文件。如果我将我的 .js 文件添加到安装文件夹中的“自定义操作”中,目前使用安装项目,当我运行安装程序时,它会在安装过程中运行我的文件。这不好,因为服务器还没有准备好注册。我需要这个 .js 文件在安装后运行。如果任何有安装项目经验的人可以帮助我,我将非常感激。但是,如果有人知道可以做我要求的更好的安装程序制造商,我也会对此非常感兴趣。也许 WIX 可以为我做到这一点?
问问题
3306 次
3 回答
1
这似乎正是您所需要的:
https://www.codeproject.com/articles/15800/calling-javascript-from-a-visual-studio-installati
这将为您提供有关安装程序项目自定义操作的更多信息:
https://www.simple-talk.com/dotnet/visual-studio/visual-studio-setup-projects-and-custom-actions/
于 2016-12-02T23:18:48.993 回答
0
将Installer 类添加到 Visual Studio 中的设置项目。您可以在此安装程序类中覆盖许多安装阶段
前任:
- OnBeforeInstall()
- 安装()
- 安装后()
您可以覆盖相关方法并在方法中添加逻辑以执行 .js 文件。
您可能需要获取安装 MSI 的目录,以便获取 .JS 文件的路径并执行它。下面的代码应该得到安装目录。在安装程序类中添加此代码。
string installationPath = Context.Parameters["assemblypath"];
于 2016-12-02T19:16:41.313 回答
-1
Try the InstallShield 2013 with a limited warranty. It should be free for personal use, and it includes a functionality to run a script after the installation is completed.
于 2016-12-02T19:25:22.677 回答