This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- Re: C# Automation.
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Mar 25, 2008
09:30 AM
C# Automation.
I want to hook my script to the StatusMessage Event, to display it.
But I've been working on that all day long and still doesn't work :s
I tried it in C#
[CODE]class Program
{
ISWiAuto14.ISWiProject ISManip = new ISWiAuto14.ISWiProject();
public Program()
{
ISManip.StatusMessage += new ISWiAuto14.__ISWiProject_StatusMessageEventHandler(OnMessage);
}
void CompileProject()
{
if (ISManip.OpenProject("C:\\Program Files\\Macrovision\\IS2008\\InstallShield 2008 Projects\\MonTest\\MonTest.ism", false) != 0)
return;
ISWiAuto14.ISWiProductConfig cfg = ISManip.ISWiProductConfigs[1];
ISWiAuto14.ISWiRelease rls = cfg.ISWiReleases[1];
rls.Build();
}
void OnMessage(String message, ref bool bCancel)
{
Console.WriteLine(message);
}
}[/CODE]
It builds, but my CallBack function for the StatusMessage isn't called.
But I've been working on that all day long and still doesn't work :s
I tried it in C#
[CODE]class Program
{
ISWiAuto14.ISWiProject ISManip = new ISWiAuto14.ISWiProject();
public Program()
{
ISManip.StatusMessage += new ISWiAuto14.__ISWiProject_StatusMessageEventHandler(OnMessage);
}
void CompileProject()
{
if (ISManip.OpenProject("C:\\Program Files\\Macrovision\\IS2008\\InstallShield 2008 Projects\\MonTest\\MonTest.ism", false) != 0)
return;
ISWiAuto14.ISWiProductConfig cfg = ISManip.ISWiProductConfigs[1];
ISWiAuto14.ISWiRelease rls = cfg.ISWiReleases[1];
rls.Build();
}
void OnMessage(String message, ref bool bCancel)
{
Console.WriteLine(message);
}
}[/CODE]
It builds, but my CallBack function for the StatusMessage isn't called.
(1) Reply
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Mar 25, 2008
10:24 AM
I got it worked...
If it can help anyone.
I was handling Project Events... But i needed to handle release event...
So by replacing :
ISManip.StatusMessage += new ISWiAuto14.__ISWiProject_StatusMessageEventHandler(OnMessage);
with
rls.StatusMessage += new ISWiAuto14.__ISWiRelease_StatusMessageEventHandler(OnMessage);
I got it worked.
If it can help anyone.
I was handling Project Events... But i needed to handle release event...
So by replacing :
ISManip.StatusMessage += new ISWiAuto14.__ISWiProject_StatusMessageEventHandler(OnMessage);
with
rls.StatusMessage += new ISWiAuto14.__ISWiRelease_StatusMessageEventHandler(OnMessage);
I got it worked.
![](/skins/images/04FED02024358F0FDF89E0836F432D6F/responsive_peak/images/icon_anonymous_message.png)