using System; using System.Drawing; using System.Collections; using System.ComponentModel; using System.Windows.Forms; using System.Data; using System.IO; using ISWiAutomation; <snip> private void frmMain_BuildISProj() { if ( txtProjectFile.Text != "" ) { string strProjectFile; strProjectFile = txtProjectFile.Text.Trim(); // Create IS object and open SMART2o project file ISWiProjectClass oISProj = new ISWiProjectClass(); oISProj.OpenProject(strProjectFile, false); //-- Build release ISWiProductConfigs oProdConfig; ISWiReleases oRelease; //-- We only have one Product Configuration and it's named "Default" // *** None of the following work oProdConfig = oISProj.ISWiProductConfigs.Item("Default"); // compiler reports no definition for 'Item' oProdConfig = (ISWiAutomation.ISWiProductConfigs) oISProj.ISWiProductConfigs.Item("Default"); // compiler reports no definition for 'Item' oProdConfig = (ISWiAutomation.ISWiProductConfigs) (oISProj.ISWiProductConfigs).Item("Default"); // *** The following is from the VS debugger "Watching" oProdConfig... going insane... // ((ISWiAutomation.ISWiProductConfigsClass)(((ISWiAutomation.ISWiProductConfigs)(oISProj.ISWiProductConfigs)))).Item("Default"); // This works at runtime, but compiler doesn't like it... oProdConfig = ((ISWiAutomation.ISWiProductConfigsClass)(((ISWiAutomation.ISWiProductConfigs)(oISProj.ISWiProductConfigs)))).Item("Default"); //-- We only have one Release and it's named "Network" // *** Nothing works when trying to get the Releases object oRelease = oProdConfig.ISWiReleases.Item("Network"); // compiler reports no definition for 'Item' oRelease = (ISWiReleases) oISProj.ISWiProductConfigs("Default").ISWiReleases("Network"); // *** Trying to mimic format displayed by debugger for oProdConfig //oRelease = ((ISWiAutomation.ISWiReleases)(((ISWiAutomation.ISWiReleases)(oProdConfig.ISWiReleases)))).Item("Network"); //oRelease.Build(); //oISProj.SaveProject(); oISProj.CloseProject(); } }All is well in VFPLand:
<snip> LOCAL lcProjFile as String, ; oISProj as "ISWiAutomation.ISWiProject" *-- Get full path and filename of SMART2.o IS project lcProjFile = "C:\test\mySetup.ism" *-- Create IS object and open SMART2o project file oISProj = CreateObject("ISWiAutomation.ISWiProject") oISProj.OpenProject( lcProjFile ) *-- Build release LOCAL loProdConfig As ISWiProductConfig LOCAL loRelease As ISWiRelease *-- We only have one Product Configuration which is named Default loProdConfig = oISProj.ISWiProductConfigs.Item("Default") *-- We only have one Release which is named Network loRelease = loProdConfig.ISWiReleases.Item("Network") loRelease.Build oISProj.SaveProject oISProj.CloseProject <snip>Can even do it with VBScript:
<snip> Dim oISProj Dim strProjFile strISMFile = "c:\test\mySetup.ism" ' Create IS object and open project file Set oISProj = CreateObject("ISWiAutomation.ISWiProject") oISProj.OpenProject strProjFile '-- Build release Dim oProdConfig Dim oRelease '-- We only have one Product Configuration and it's named Default Set oProdConfig = oISProj.ISWiProductConfigs.Item("Default") '-- We only have one Release and it's named Network Set oRelease = oProdConfig.ISWiReleases.Item("Network") oRelease.Build oISProj.SaveProject oISProj.CloseProject <snip>