Jump to content


This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Photo

Calling installScript from setup


5 replies to this topic

Baha

Baha
  • Members
  • 1 posts

Posted 03 July 2001 - 15:36

Hi, all
I'm new to ISWI (2.03). To get going I need a simple explenation how to create a custom action that calls a script-file. The only thing that this script has to do is, to show a message and set a property in the setup. After that I want to use that property in my further dialogs.

Can anyone help with this simple question?

Thanks.


Leigh Ravenhall

Leigh Ravenhall
  • Members
  • 269 posts

Posted 04 July 2001 - 02:16

To create a custom action to run some installscript, your installscript function can only take a single parameter, which is a handle for the current install.  You will need to prototype it with something similar to the following:
export prototype MyFunc(HWND);

Then write the script, as follows:
function MyFunc(hMSI)
   STRING svVar1;
begin
   <Script commands>
end;

To create the custom action that will run the script, the easiest method is to use the Custom Action Wizard.  Right click on Custom Actions, select Custom Action Wizard, give the CA a name.  The type specified is Run InstallScript code.  Scrolling through the list in source, you should be able to find the name of your custom action.  Leaving everything else default should be acceptable.

This custom action can then be inserted wherever you want to run it.

Hope this helps,


MetinSenkal

MetinSenkal
  • Members
  • 15 posts

Posted 04 July 2001 - 09:53

After running custom action that calls installscript, how can we set a property that is calculated in the script?

Best Regards,
Metin SENKAL


gowen

gowen
  • Members
  • 15 posts

Posted 04 July 2001 - 11:25

In your Installscript call the function MsiSetProperty as follows:

MsiSetProperty(hMSI, szPropertyName, szPropertyValue);

Where:
- hMSI is the Windows Handle passed into the function.
- szPropertyName is a string containing the property to be set.  If you are setting the property in the User Sequence and want to read it in the execute sequence, make the property public but having it's name all in capital letters.
- szPropertyValue is a STRING containing the properties value. If you want to store a number use NumToStr(svString,nValue).

I hope this answers your question.


ConfigControl

ConfigControl
  • Full Members
  • 34 posts

Posted 06 July 2001 - 20:25

I have set a public property (VER13X) in the UI sequence using the MsiSetProperty() function but I can get (MsiGetProperty()) in the Execute sequence. What could cause the public property not to be passed?

Thanks,


MetinSenkal

MetinSenkal
  • Members
  • 15 posts

Posted 09 July 2001 - 07:16

There is a related topic, Properties set in Dialogs, in the End User Interface forum. Have a look, it may be helpful.


Metin SENKAL