cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
arsirantala
Level 5

Automation interface (IswiAuto14.ISWiProject) not working

I have a javascript to update installshield project's version number. Script worked fine for versions 12 and below (down to 11.5, haven't tried versions below that), but for IS 2008 the code doesn't work. It'll result to "object error" error message in javascript.

Error comes from the first try catch. Any ideas?

edit: in same build machine we have IS 11.5 premier, 12 Pro. also the IS 2008 isn't activated yet. If those could affect for this problem.

function IS2008SetVersion(strProjectFile, strVersion, strProdConf)
{
try
{
try
{
var project = new ActiveXObject("IswiAuto14.ISWiProject");
}
catch (e)
{
alert("error: " + e);
throw e;
}

project.OpenProject(strProjectFile);
project.ProductVersion = strVersion;
project.PackageCode = NewGuidString();
project.ProductCode = NewGuidString();

// For some reason InstallShield does not use the project.ProductCode
// for the installer package so we must set it manually in the
// product config section
// This might be a bug in InstallShield
project.ISWiProductConfigs(strProdConf).ProductCode = project.ProductCode;

// Update Upgrade table with new versions
//
// This is a hack to change the upgrade version numbers in the
// upgrade table. One should use InstallSHield properties in
// the upgrade table, but for some reason they do not work.
//
// NOTE: If any other value for the upgrade table than the
// current product version is used, this code corrupts the
// installshield project file
var i=0;
for (i=1; i<=project.IswiUpgradeTableEntries.Count; i++)
{
var objUpgradeEntry = project.IswiUpgradeTableEntries(i);
if (!(objUpgradeEntry.VersionMax == "" || objUpgradeEntry.VersionMax == null))
objUpgradeEntry.VersionMax = strVersion;
if (!(objUpgradeEntry.VersionMin == "" || objUpgradeEntry.VersionMin == null))
objUpgradeEntry.VersionMin = strVersion;
}

project.SaveProject();
project.CloseProject();
}
catch (e)
{
throw e;
}
}
Labels (1)
0 Kudos
(3) Replies
praveendanam
Level 5

hai,

try to use msi platform sdk

-praveen
0 Kudos
arsirantala
Level 5

That is one solution for the problem.. after some testing, I think the problem isn't in the script itself (afterall), but in the caller. We use here Finalbuilder 4.0, and as of it's project it to create the installers for the product.

I think the FB (finalbuilder) is not able to find the automation interface COM components for version 2008 - for some reason.

As a alternative method, I've placed the logic from the script (which was embedded to the finalbuilder's project) to an external script file, which I now call from fb. I didn't get any such errors as stated above.

what makes me wonder isn't the way how the javascript tries to create an object from COM component the same whatever its in script file, or as a script in finalbuilder project?
0 Kudos
praveendanam
Level 5

hai,

If i understood correctly is12 onwards standalone build also requires license. so better use sdk.

-praveen
0 Kudos