cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
SkiTrak
Level 3

Accessing the Automation Interface in c#

Is there a example of working with the Automation Interface in c#?
Labels (1)
0 Kudos
(5) Replies
Christopher_Pai
Level 16

Add the COM reference, namespace alias and start off with the ISWiProject class. The rest will look alot like jscript.
0 Kudos
SkiTrak
Level 3

Thanks for your reply!

Do you need to add a Reference to a IS dll?
0 Kudos
Christopher_Pai
Level 16

No, when you add the reference, click on the COM tab and find the ISAuto15 ( or whetever it's called, can't remember off the top of my head ) and Visual Studio will generate an interop assembly for you. Look at it in the object browser and you'll see the namespaces and classes that it encapsulates.
0 Kudos
SkiTrak
Level 3

I am running InstallShield 10
I have the following simple program that when it tries to load the project I get a exception "Could Not Create Temp File". I have closed Install Shield so it should be the only thing having the project open.

Any ideas?

using System;
using System.Collections.Generic;
using System.Text;
using System.IO;
using ISWiAuto16;
using ISWIBUILDLib;

namespace PreInstall
{
class Program
{
static void Main(string[] args)
{
if (args.Length != 1)
{
Console.WriteLine("Invalid Command Line Arguments!\n");
Console.WriteLine("Usage:\n\t\tPreInstall ");
return;
}

ISWiProject project = new ISWiProject();

try
{
int ret = project.OpenProject(args[0], true);
}
catch (Exception e)
{
}
}
}
}
0 Kudos
SkiTrak
Level 3

The ism file argument args[0] was not correct. I corrected it and the project loads.
0 Kudos