gpt4 book ai didi

installation - InstallShield - 获取文件的版本

转载 作者:行者123 更新时间:2023-12-05 00:43:16 24 4
gpt4 key购买 nike

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

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

最佳答案

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

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

2) 使用SQL,您可以通过编程方式获取product_name 并设置*.exe 名称。在 Direct Editor(安装设计器 -> 其他工具 -> Direct Editor)中搜索您需要的表/值的确切位置。例如(如下),使用 VBScript,我修改了我拉入 IS 项目的文件的安装根目录的路径。同样,这可以对 IS Direct Editor 中的任何表进行。使用诸如 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

关于installation - InstallShield - 获取文件的版本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1290308/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com