c# - 仅在使用 installshield 安装应用程序时执行代码

标签 c# registry installshield

我只是想知道是否可以在安装应用程序时只运行一次小代码。

我想用安装路径创建一个注册表。我之所以需要它,是因为我的应用程序中也有一个 Windows 服务,安装路径总是更改为 system32。

我有一个 ini 文件,它是在安装时在安装文件夹中创建的。我还需要使用我的服务和 Windows 窗体访问该文件。

最佳答案

您不需要任何额外的代码,只需在 HKLM\software\yoursoftware 中创建一个注册表项,在您的安装中使用像 Installpath 这样的键名称和 [INSTALLDIR] 的值,然后在您的服务中引用该键。

这假设您在 install shield 中使用基本的 MSI 项目。

关于c# - 仅在使用 installshield 安装应用程序时执行代码,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15829789/

相关文章:

c# - XPTable 滚动出错

c# - 将 datarow[] 转换为 List<int> 的最佳方法是什么?

c# - 如何使我的 C# DLL 成为自注册 dll

installshield - 如何将参数传递给用 C# 编写的托管代码 dll 的自定义操作?

c# - 反序列化错误 ASP.NET MongoDB

c# - 在 App.cs (Xamarin) 中显示 DisplayAlert

c++ - 在运行时检查 Windows 是否为 64 位的正确方法? (C++)

windows - 如何创建行为类似于 .cmd/.bat 的文件扩展名?

c# - 关于自定义操作 Installshield 失败的自定义消息

32bit-64bit - 安装盾2012 : Identify 32 or 64 bit Operating system and install appropriate ActiveX control - Basic msi installer