4

我正在使用 InstallShield 2010,想知道是否有人知道如何执行以下操作:

我想在我的安装程序中获取我的主 exe 版本,并将其作为我的 setup.exe InstallShield 正在生成的名称。知道怎么做吗?

4

2 回答 2

3

我能够使用自动化服务来完成这项工作,这是 InstallShield 的编程接口。每当我在 Visual Studio 中为我的 exe 构建项目时,我都会在 Post-build 中运行一个 exe,它将 InstallSheild 项目设置为相同的版本。

于 2009-08-24T13:16:55.590 回答
3

有几种方法可以做到这一点....取决于您的 IS 项目类型(MSI、installscript 等)

1)在属性管理器中创建一个变量,例如Product_Name,在你的安装脚本中设置它并检索它来修改你的*.exe名称

2) 使用 SQL,您可以通过编程方式获取 product_name 并设置 *.exe 名称。在直接编辑器(安装设计器 -> 附加工具 -> 直接编辑器)中搜索您需要的表/值的确切位置。例如(如下),我使用 VBScript 修改了我拉入 IS 项目的文件的安装根目录的路径。同样,这可以对 IS 直接编辑器中的任何表进行。我相信使用 Visual build Pro 之类的工具也会对您有所帮助。值得~100美元!

    Set oMSI = CreateObject("WindowsInstaller.Installer")
    On Error Resume Next

    ' open ISM file in transacted mode
    Set oDB = oMSI.OpenDatabase("C:\Path\to\myProject.ism", 1)

    strQuery = "Select * FROM `ISPathVariable` WHERE `ISPathVariable`.`ISPathVariable` = 'InstallTreeFolder'"

'////////////////////////////////////////////////////////////  
'// Update Path Variable

' fetch the one and only samplesource record
Set oView = oDB.OpenView(strQuery)
oView.Execute
Set oRec = oView.Fetch

' change field 2, the Value field
oRec.StringData(2) = "%INSTALL_TREE_ROOT%"

' update the changed record
oView.Modify 2, oRec

' close the view, commit changes, clean up
oView.Close: oDB.Commit: Set oMSI = Nothing
于 2009-08-20T15:28:49.980 回答