InstallShield安装打包编译自动化(3)- 更新Package GUID,Product GUID以及Upgrade GUID
2010-09-01 13:46
591 查看
版权声明: 可以任意转载,转载时请务必以超链接形式标明文章原始出处和作者信息。
在自动化编译过程中,如何修改产品的GUID,Package的GUID以及升级的GUID,受网友fishout的启发,找到了一些相关方面的资料,特与大家分享。
关于InstallShield内部用脚本实现GUID的生成,请大家关注fishout的Blog他应该会更新到自己的Blog中的。
下面是Aaron McLean写的一段VBScript示例代码,引用请保留原作者信息。
另外注意ISWiAutomation版本的不同,之前曾向导大家介绍过。
InstallShield 2009和2010的GUID生成实例:
'Welcome to GuidChange 2009 and 2010 . Written by Aaron McLean. Written July 2001, Published November 2002, edited 2009
'After 7 years I was asked to update the code to support IS 2009 and 2010
'Use GuidChange 2009 and 2010.vbs for Installshield 2009 and 2010.
'Use GuidChange.vbs for IPWI 2.03, Developer 7.x, 8.x - Admin Studio
'This is freeware as long as you keep mention my name in your code
'
'You will need a few things installed on your computer to run this Visual Basic Script
'-VB6 Runtime and Windows Scripting Host - www.microsoft.com/scripting. Install Microsoft 'Windows Script 5.6 Download'
'Drop an *.ism on guid.vbs
'Supports Multiple *.ism's
'Delete the last line if you don't want the message box - >>> msgbox "I'm done"
'Send questions to aaronmclean@sbcglobal.net
'---- ACCESS A FEW OF COM OBJECTS
set fs = CreateObject("Scripting.FileSystemObject")
set wshshell = CreateObject("wscript.shell")
Set installer = wscript.CreateObject("WindowsInstaller.Installer")
set args = Wscript.Arguments
'Changed 9/10/2009 to use Installshield 2009 and 2010 COM naming conventions
'Set GUID = CreateObject("InstallShield.Guid")
Set GUID = CreateObject("ISWizUtil.CGUID")
'---- If I get double clicked then show message box and quit
Dim argCount:argCount = Wscript.Arguments.Count
if argcount < 1 then
MsgBox "Drop an *.ism on me and I will change the Package GUID, Product GUID, Upgrade GUID" & vbcr & vbcr & "GuidChange 1.0 Written by Aaron McLean, July 2001, Published November 2002"
Wscript.Quit 1
end if
'---- If I find a ? in the cmd line then show the help and quit
if argcount >= 1 then
If InStr(Wscript.Arguments(0), "?") Then ' Manual Launch from a command line
MsgBox "Drop an *.ism on me and I will change the Package GUID, Product GUID, Upgrade GUID" & vbcr & vbcr & "GuidChange 1.0 Written by Aaron McLean, July 2001, Published November 2002"
Wscript.Quit 1
end if
'---- If I find an *.ism in the cmd line then change the upgrade, package, and product guids.
'---- guid.vbs will change multiple *.ism's at one time
'---- The For statement is used to loop through all of the *.ism's that are dropped on GuidChange
For each argument in args ' :msgbox " Argument: " & argument
Set fileStuff = fs.GetFile(argument)
if CBool(fs.GetFile(fileStuff).Attributes and 1) = TRUE then ' Is the file read only?
fileStuff.Attributes = fileStuff.Attributes and not 14000 and not 1 ' Then remove the read only Attrib
end if
if instr(fileStuff,".ism") then 'Is this an Installshield Project
'Changed 9/10/2009 to use Installshield 2009 and 2010 COM naming conventions
'Set pProject = CreateObject ("ISWiAutomation.ISWiProject")
Set pProject = CreateObject ("ISWiAuto16.ISWiProject")
pProject.OpenProject fileStuff, True
pProject.PackageCode = GUID.CreateGUID() 'Delete this entire line if you don't want the package guid changed
pProject.ProductCode = GUID.CreateGUID() 'Delete this entire line if you don't want the product guid changed
pProject.UpgradeCode = GUID.CreateGUID() 'Delete this entire line if you don't want the upgrade guid changed
pProject.SaveProject 'Saving the *.ism before closing it
pProject.CloseProject 'Closing the *.ism
else
MsgBox "Only Installshield files with the *.ism file extension can be changed. Good-Bye"
Wscript.quit 1
end if
next
end if
msgbox "I'm done"
'Credits:
'Installshield created the GUID object下面是针对IPWI 2.03,InstallShield Developer 7.x,8.x以及AdminStudio的示例代码:
'Use GuidChange 2009 and 2010.vbs for Installshield 2009 and 2010.
'Use GuidChange.vbs for IPWI 2.03, Developer 7.x, 8.x - Admin Studio
'This is freeware as long as you keep mention my name in your code
'
'You will need a few things installed on your computer to run this Visual Basic Script
'-VB6 Runtime and Windows Scripting Host - www.microsoft.com/scripting. Install Microsoft 'Windows Script 5.6 Download'
'Drop an *.ism on guid.vbs
'Supports Multiple *.ism's
'Delete the last line if you don't want the message box - >>> msgbox "I'm done"
'Send questions to aaronmclean@sbcglobal.net
'---- ACCESS A FEW OF COM OBJECTS
set fs = CreateObject("Scripting.FileSystemObject")
set wshshell = CreateObject("wscript.shell")
Set installer = wscript.CreateObject("WindowsInstaller.Installer")
set args = Wscript.Arguments
Set GUID = CreateObject("InstallShield.Guid")
'---- If I get double clicked then show message box and quit
Dim argCount:argCount = Wscript.Arguments.Count
if argcount < 1 then
MsgBox "Drop an *.ism on me and I will change the Package GUID, Product GUID, Upgrade GUID" & vbcr & vbcr & "GuidChange 1.0 Written by Aaron McLean, July 2001, Published November 2002"
Wscript.Quit 1
end if
'---- If I find a ? in the cmd line then show the help and quit
if argcount >= 1 then
If InStr(Wscript.Arguments(0), "?") Then ' Manual Launch from a command line
MsgBox "Drop an *.ism on me and I will change the Package GUID, Product GUID, Upgrade GUID" & vbcr & vbcr & "GuidChange 1.0 Written by Aaron McLean, July 2001, Published November 2002"
Wscript.Quit 1
end if
'---- If I find an *.ism in the cmd line then change the upgrade, package, and product guids.
'---- guid.vbs will change multiple *.ism's at one time
'---- The For statement is used to loop through all of the *.ism's that are dropped on GuidChange
For each argument in args ' :msgbox " Argument: " & argument
Set fileStuff = fs.GetFile(argument)
if CBool(fs.GetFile(fileStuff).Attributes and 1) = TRUE then ' Is the file read only?
fileStuff.Attributes = fileStuff.Attributes and not 14000 and not 1 ' Then remove the read only Attrib
end if
if instr(fileStuff,".ism") then 'Is this an Installshield Project
Set pProject = CreateObject ("ISWiAutomation.ISWiProject")
pProject.OpenProject fileStuff, True
pProject.PackageCode = GUID.CreateGUID() 'Delete this entire line if you don't want the package guid changed
pProject.ProductCode = GUID.CreateGUID() 'Delete this entire line if you don't want the product guid changed
pProject.UpgradeCode = GUID.CreateGUID() 'Delete this entire line if you don't want the upgrade guid changed
pProject.SaveProject 'Saving the *.ism before closing it
pProject.CloseProject 'Closing the *.ism
else
MsgBox "Only Installshield files with the *.ism file extension can be changed. Good-Bye"
Wscript.quit 1
end if
next
end if
msgbox "I'm done"
'Credits:
'Installshield created the GUID object参考链接:
http://community.flexerasoftware.com/showthread.php?t=189920 http://community.flexerasoftware.com/showthread.php?t=171334
在自动化编译过程中,如何修改产品的GUID,Package的GUID以及升级的GUID,受网友fishout的启发,找到了一些相关方面的资料,特与大家分享。
关于InstallShield内部用脚本实现GUID的生成,请大家关注fishout的Blog他应该会更新到自己的Blog中的。
下面是Aaron McLean写的一段VBScript示例代码,引用请保留原作者信息。
另外注意ISWiAutomation版本的不同,之前曾向导大家介绍过。
InstallShield 2009和2010的GUID生成实例:
'Welcome to GuidChange 2009 and 2010 . Written by Aaron McLean. Written July 2001, Published November 2002, edited 2009
'After 7 years I was asked to update the code to support IS 2009 and 2010
'Use GuidChange 2009 and 2010.vbs for Installshield 2009 and 2010.
'Use GuidChange.vbs for IPWI 2.03, Developer 7.x, 8.x - Admin Studio
'This is freeware as long as you keep mention my name in your code
'
'You will need a few things installed on your computer to run this Visual Basic Script
'-VB6 Runtime and Windows Scripting Host - www.microsoft.com/scripting. Install Microsoft 'Windows Script 5.6 Download'
'Drop an *.ism on guid.vbs
'Supports Multiple *.ism's
'Delete the last line if you don't want the message box - >>> msgbox "I'm done"
'Send questions to aaronmclean@sbcglobal.net
'---- ACCESS A FEW OF COM OBJECTS
set fs = CreateObject("Scripting.FileSystemObject")
set wshshell = CreateObject("wscript.shell")
Set installer = wscript.CreateObject("WindowsInstaller.Installer")
set args = Wscript.Arguments
'Changed 9/10/2009 to use Installshield 2009 and 2010 COM naming conventions
'Set GUID = CreateObject("InstallShield.Guid")
Set GUID = CreateObject("ISWizUtil.CGUID")
'---- If I get double clicked then show message box and quit
Dim argCount:argCount = Wscript.Arguments.Count
if argcount < 1 then
MsgBox "Drop an *.ism on me and I will change the Package GUID, Product GUID, Upgrade GUID" & vbcr & vbcr & "GuidChange 1.0 Written by Aaron McLean, July 2001, Published November 2002"
Wscript.Quit 1
end if
'---- If I find a ? in the cmd line then show the help and quit
if argcount >= 1 then
If InStr(Wscript.Arguments(0), "?") Then ' Manual Launch from a command line
MsgBox "Drop an *.ism on me and I will change the Package GUID, Product GUID, Upgrade GUID" & vbcr & vbcr & "GuidChange 1.0 Written by Aaron McLean, July 2001, Published November 2002"
Wscript.Quit 1
end if
'---- If I find an *.ism in the cmd line then change the upgrade, package, and product guids.
'---- guid.vbs will change multiple *.ism's at one time
'---- The For statement is used to loop through all of the *.ism's that are dropped on GuidChange
For each argument in args ' :msgbox " Argument: " & argument
Set fileStuff = fs.GetFile(argument)
if CBool(fs.GetFile(fileStuff).Attributes and 1) = TRUE then ' Is the file read only?
fileStuff.Attributes = fileStuff.Attributes and not 14000 and not 1 ' Then remove the read only Attrib
end if
if instr(fileStuff,".ism") then 'Is this an Installshield Project
'Changed 9/10/2009 to use Installshield 2009 and 2010 COM naming conventions
'Set pProject = CreateObject ("ISWiAutomation.ISWiProject")
Set pProject = CreateObject ("ISWiAuto16.ISWiProject")
pProject.OpenProject fileStuff, True
pProject.PackageCode = GUID.CreateGUID() 'Delete this entire line if you don't want the package guid changed
pProject.ProductCode = GUID.CreateGUID() 'Delete this entire line if you don't want the product guid changed
pProject.UpgradeCode = GUID.CreateGUID() 'Delete this entire line if you don't want the upgrade guid changed
pProject.SaveProject 'Saving the *.ism before closing it
pProject.CloseProject 'Closing the *.ism
else
MsgBox "Only Installshield files with the *.ism file extension can be changed. Good-Bye"
Wscript.quit 1
end if
next
end if
msgbox "I'm done"
'Credits:
'Installshield created the GUID object下面是针对IPWI 2.03,InstallShield Developer 7.x,8.x以及AdminStudio的示例代码:
'Use GuidChange 2009 and 2010.vbs for Installshield 2009 and 2010.
'Use GuidChange.vbs for IPWI 2.03, Developer 7.x, 8.x - Admin Studio
'This is freeware as long as you keep mention my name in your code
'
'You will need a few things installed on your computer to run this Visual Basic Script
'-VB6 Runtime and Windows Scripting Host - www.microsoft.com/scripting. Install Microsoft 'Windows Script 5.6 Download'
'Drop an *.ism on guid.vbs
'Supports Multiple *.ism's
'Delete the last line if you don't want the message box - >>> msgbox "I'm done"
'Send questions to aaronmclean@sbcglobal.net
'---- ACCESS A FEW OF COM OBJECTS
set fs = CreateObject("Scripting.FileSystemObject")
set wshshell = CreateObject("wscript.shell")
Set installer = wscript.CreateObject("WindowsInstaller.Installer")
set args = Wscript.Arguments
Set GUID = CreateObject("InstallShield.Guid")
'---- If I get double clicked then show message box and quit
Dim argCount:argCount = Wscript.Arguments.Count
if argcount < 1 then
MsgBox "Drop an *.ism on me and I will change the Package GUID, Product GUID, Upgrade GUID" & vbcr & vbcr & "GuidChange 1.0 Written by Aaron McLean, July 2001, Published November 2002"
Wscript.Quit 1
end if
'---- If I find a ? in the cmd line then show the help and quit
if argcount >= 1 then
If InStr(Wscript.Arguments(0), "?") Then ' Manual Launch from a command line
MsgBox "Drop an *.ism on me and I will change the Package GUID, Product GUID, Upgrade GUID" & vbcr & vbcr & "GuidChange 1.0 Written by Aaron McLean, July 2001, Published November 2002"
Wscript.Quit 1
end if
'---- If I find an *.ism in the cmd line then change the upgrade, package, and product guids.
'---- guid.vbs will change multiple *.ism's at one time
'---- The For statement is used to loop through all of the *.ism's that are dropped on GuidChange
For each argument in args ' :msgbox " Argument: " & argument
Set fileStuff = fs.GetFile(argument)
if CBool(fs.GetFile(fileStuff).Attributes and 1) = TRUE then ' Is the file read only?
fileStuff.Attributes = fileStuff.Attributes and not 14000 and not 1 ' Then remove the read only Attrib
end if
if instr(fileStuff,".ism") then 'Is this an Installshield Project
Set pProject = CreateObject ("ISWiAutomation.ISWiProject")
pProject.OpenProject fileStuff, True
pProject.PackageCode = GUID.CreateGUID() 'Delete this entire line if you don't want the package guid changed
pProject.ProductCode = GUID.CreateGUID() 'Delete this entire line if you don't want the product guid changed
pProject.UpgradeCode = GUID.CreateGUID() 'Delete this entire line if you don't want the upgrade guid changed
pProject.SaveProject 'Saving the *.ism before closing it
pProject.CloseProject 'Closing the *.ism
else
MsgBox "Only Installshield files with the *.ism file extension can be changed. Good-Bye"
Wscript.quit 1
end if
next
end if
msgbox "I'm done"
'Credits:
'Installshield created the GUID object参考链接:
http://community.flexerasoftware.com/showthread.php?t=189920 http://community.flexerasoftware.com/showthread.php?t=171334
相关文章推荐
- InstallShield安装打包编译自动化(1) - 通过命令行进行源代码控制操作
- InstallShield安装打包编译自动化(2) - 通过命令行修改InstallShield工程
- InstallShield安装打包编译自动化(1) - 通过命令行进行源代码控制操作
- InstallShield安装打包编译自动化(2) - 通过命令行修改InstallShield工程
- sbt的安装以及用sbt编译打包scala编写的spark程序
- iOS 安装证书 打包上线 以及版本更新
- Android使用Jenkins完成自动化打包操作---Jenkins的安装以及基础配置
- Saltstack自动化源码编译安装PHP以及LNMP安装整合
- LTMP手动编译安装以及全自动化部署实践
- android自动化打包,只在编译打包时更改包名packagename
- ASP.Net一键自动化更新代码、编译、合并dll、压缩js、css、混淆dll、zip打包、发布到测试环境的bat批处理
- IzPack打包工具 源码编译、安装、使用
- ubuntu下安装less以及实现简单的编译
- 集成安装5 使用Jenkins打包编译发布项目
- [转]编译安装libevent,memcache,以及php的memcached扩展
- Linux下安装FFMPEG 编译 以及基本的Demo开发
- 用InstallShield打包多个需要分别安装的软件
- PowerShell 在 SharePoint 2010 自动化部署中的应用(2)-编译打包
- Android中检查更新APK,以及下载APK安装。
- NanoPi—M1(H3)———HAL程序编译、打包进安卓系统镜像以及so文件存放位置