Automation MSI Script Syntax

Got a problem you cannot solve? Try here.
gagandeep.sharma
Posts: 8
Joined: Tue Sep 03, 2013 6:48 am

Automation MSI Script Syntax

Postby gagandeep.sharma » Wed Sep 11, 2013 5:45 am

Hi Guys, I'm having some issue with MSI Scripting and the automation code.

Basically, I hav my IA project ready with msi script and every thing. Now I'm creating a .NET project to create same IA project dynamically using automation template.
here i'm having problem with its msicoding style in writing many syntax.

this time i'm unable to write Compile If into my C# code to create automation. See my attachments :-

Image1 : It describe the code written into msi coding, which I need to automate in C#.

Image2 : describe the C# code written for simple if. I wanted same code style for the [Compiler If]. Please help.

It would be good if you can refer any keyword reference for the automation as I'm finding difficulties into their manipulation. For example I guess the integer value "0" for "Administrative Right" being used some where into the script. Any help will be appreciable.
thanks :)
Attachments
image2.png
image2.png (5.19 KiB) Viewed 6730 times
image1.png
image1.png (13.28 KiB) Viewed 6730 times

gagandeep.sharma
Posts: 8
Joined: Tue Sep 03, 2013 6:48 am

Re: Automation MSI Script Syntax

Postby gagandeep.sharma » Wed Sep 11, 2013 7:34 am

May be I have not explained my question well. My question in simple language : "how to write automation command in C# for 'Compile If' statement as shown into the image" ?.

I'm also having same problem for the other command also like "(Un)Install MSI Package" is an script option which is generating some script as "Install/Remove msi package blaa blaa blaa" ...Now how to write this into the C# automation command for automation interface. Basically I wanted some reference where i could see the msi command and their corresponding automation commands in C# particularly.

bokkie
Posts: 767
Joined: Sun Feb 08, 2009 6:30 am

Re: Automation MSI Script Syntax

Postby bokkie » Wed Sep 11, 2013 8:16 am

Its been a long time since I used the automation.

What happens if you insert a statement like iaScript.AddCommand("[compiler if Variable QQQ Equals 34]", "")?

If it emits the statement into the MSIcode without a problem, you could think about building the string and replacing QQQ and 34 with your values when you create the project. I've never tried it but while waiting for a simpler answer, you've got nothing to lose while you're waiting. :wink:
Peter. Smartly dressed, he still resembles an unmade bed.
InstallAware MVP

gagandeep.sharma
Posts: 8
Joined: Tue Sep 03, 2013 6:48 am

Re: Automation MSI Script Syntax

Postby gagandeep.sharma » Wed Sep 11, 2013 9:34 am

Hi bokkie

Thanks for you reply, I will try this solution too. Although i did many hit n try but couldn't succeeded. I was wondering about any documentation related to the automation command syntax, do you hav any reference or any link for automation syntax of msi coding command ? bcoz this seems very crucial if i'm gonna change my whole project into automated project which is having around 500+ line of msi coding.

I would be happy, if somebody could provide exact help. Thanks

FrancescoT
Site Admin
Posts: 5361
Joined: Sun Aug 22, 2010 4:28 am

Re: Automation MSI Script Syntax

Postby FrancescoT » Wed Sep 11, 2013 11:33 am

Dear Users,

The easiest way to understand how the Automation code syntax has to be passed with the respective Automation SDK command, it is with inspecting how the equivalent IA command is stored by IA internally.

For example, supposing that you want to issue via automation a command to Display a MessageBox, type the command within the MSI code editor in IA IDE;

Code: Select all

MessageBox: Dialog Title, Dialog Message

Select the code statement and copy it as InstallAware Clipboard format (right click and select Copy ... not Copy as Text), then past the Clipbord contens in a Text file (NotePad is perfect) and you will have;

Code: Select all

~InstallAware Clipboard Data~
~MessageBox~
~{CF1A00E6-162A-4122-A476-721DDF20532F}~
~Dialog Title~
~Dialog Message~
~0~
~1~
~~

Due the above command sequence, the MessageBox command requires the following 5 parameters;

Code: Select all

"(1)Dialog Title","(2)Dialog Message","(3)0","(4)1","(5)"

Finally, the correct syntiax to issue the command via Automation using the "AddCommand" API Function will be (the following code uses the Escape character sequence required by C#);

Code: Select all

AddCommand("MessageBox", "\"Dialog Title\",\"Dialog Message.\",\"\"0\",\"1\",\"\"");


Anyway, the same description on how to "discover the exact parameters of any command" accepted by the Automation interface ... it is reported with that available IA documentation.

That's it!

Regards
Francesco Toscano
InstallAware Software

White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE

gagandeep.sharma
Posts: 8
Joined: Tue Sep 03, 2013 6:48 am

Re: Automation MSI Script Syntax

Postby gagandeep.sharma » Wed Sep 11, 2013 11:52 am

Hye FrancescoT, I think you resolved my all prob :D tomorrow morning I will try this first. thanks a lot :) :)

FrancescoT
Site Admin
Posts: 5361
Joined: Sun Aug 22, 2010 4:28 am

Re: Automation MSI Script Syntax

Postby FrancescoT » Wed Sep 11, 2013 12:16 pm

:D :D :D
Francesco Toscano
InstallAware Software

White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE


Return to “Technical Support”

Who is online

Users browsing this forum: No registered users and 117 guests