We’re moving our forums to a new platform.

You can still browse and search existing topics, but you can no longer create new topics or post replies.

For questions, technical issues, or feature requests, please don’t hesitate to contact our support team at support@advancedinstaller.com.

Thank you for your understanding!

lionelsiu
Posts: 19
Joined: Fri Jul 26, 2013 4:11 am

[Question] Help with a building script

Hi all, I have a script which is used for InstallShield building project.
Below is the script:

Code: Select all

szEnv = "Environment";
pEnv = &szEnv;
SendMessage (HWND_BROADCAST, WM_WININICHANGE, 0, pEnv );
I want to know how can I put this script into the Advanced Installer, or how can I use the UI to include the above action in the setup?
Thanks for help!
Dan
Posts: 4530
Joined: Wed Apr 24, 2013 3:51 pm

Re: [Question] Help with a building script

Hello and welcome to Advanced Installer forums,

Thank you for your interest in Advanced Installer.

In order to achieve that you can go in the “Custom Actions” page and add a predefined Launch attached file custom action with sequence. This type of custom action can execute an application (EXE or DLL) or run a script (VBScript or Java script). Also, the source file will be embedded in the MSI file but will not be deployed at install time with the other application files.

If you need any help, please let us know.

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
lionelsiu
Posts: 19
Joined: Fri Jul 26, 2013 4:11 am

Re: [Question] Help with a building script

Thanks for your reply!
I still have another question about a script.

Supposed I have a textbox with property name ='key_field'
I want to add a script to validate the pattern of the text in key_field (How can I get the text in the textbox?) . If the pattern is matched, it will return true, otherwise false.
Below is the concept of the validation function:

Code: Select all

function validateKey()
if Pattern_Match(key_field.Text) then
return true;
else 
return false;
Thank you!
Dan
Posts: 4530
Joined: Wed Apr 24, 2013 3:51 pm

Re: [Question] Help with a building script

Hello,

In order to take the user input property field in a variable, you can use the the following statement:

Code: Select all

value = Session.Property("key_field")
So, the Session.Property is a read-write property that represents the string value of a named installer property .

You can also use the C++ approach to to get the value for an installer property you can take a look
on the MsiGetProperty function.

You can also take a look on our “Integrate Licensing support in C++ applications” article where you will also find a small sample of Advanced Installer project implementing and extending the above functionality.

Let us know if you have any more questions.

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
lionelsiu
Posts: 19
Joined: Fri Jul 26, 2013 4:11 am

Re: [Question] Help with a building script

Thanks for your answer!

I am still confusing with my first problem, how can I translate the following script from InstallShield into Advanced Installer's custom script?
Thank you!

Code: Select all

#define WM_WININICHANGE 0x001A
	#define HWND_BROADCAST 0xffff

szEnv = "Environment";
 			pEnv = &szEnv;
			SendMessage (HWND_BROADCAST, WM_WININICHANGE, 0, pEnv );
Dan
Posts: 4530
Joined: Wed Apr 24, 2013 3:51 pm

Re: [Question] Help with a building script

Hello,

I'm not sure I fully understand your scenario. Can you please give us more details about what you are trying to achieve with that script? Please note that we don't have a native custom action scripting language.

We also recommend you to use a DLL custom action for example, you can create your custom action as a custom action written in C# or a custom action written in C++, instead of VBScript and you can see some reasons why not to use VBScript .

In this article you can find some information and examples about VBScript.

Then you can go in the “Custom Actions” page and add a predefined Launch attached file custom action with sequence. This type of custom action can execute an application (EXE or DLL) or run a script (VBScript or Java script). Also, the source file will be embedded in the MSI file but will not be deployed at install time with the other application files.

If you need any help, please let us know.

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”