InstallShield Basic MSI project generate New GUID by CommandLine IsCmdBld.exe
Asked Answered
R

2

7

I have an Installshield project .ism and I want to be able to run it by command line. It's there a possible way to generate a new Product Code by CommadnLine using IsCmdBld.exe

Note: Can't use another build software

Thanks in advance

Reformation answered 7/3, 2017 at 21:30 Comment(0)
L
9

As @Steve mention you cannot generate new Product Code via command line, but what you can is set new product code with command line. What you need is generate random GUID with a 3rd party application (or use automation) and you may set this new GUID in command line as follow ...

IsCmdBld.exe -z "ProductCode={D1B1C3E2-AA6F-455C-8533-C642EED0512D}"

Yet another thing I would like to mention ... I hope you understand that by replacing product code of your package, it will perform "major" upgrade every time. Is this what you want to do? Usually developers are trying to avoid "major" upgrades of products and do minor upgrades as the products evolve.

Lindley answered 8/3, 2017 at 19:33 Comment(2)
Works fine, the answer don't cover all that i needed but worth the vote. In addition, I used PowerShell to generate dynamically the GUID and perform other tasksReformation
To generate a GUID with PowerShell in the correct format for product codes execute (New-Guid).ToString("B").ToUpper() in a PowerShell.Nepheline
D
3

You can't via the command line tool, but you can via the automation interface if you have a recent version of InstallShield (not sure which version the availability of automation was added).

Here's an example of how to do that in C#.

// You'll need to add a reference in your C# project
// for ISWiAuto19 (may also work with ISWiAuto16)
var is1 = new ISWiAuto19.ISWiProject();
is1.OpenProject("path to ism project file")
is1.ProductCode = Guid.NewGuid();
is1.SaveProject();
is1.CloseProject();

More details can be found here: http://helpnet.installshield.com/installshield19helplib/helplibrary/IHelpAutoISWiProject.htm

Dinghy answered 8/3, 2017 at 17:0 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.