Script not running. - Advanced Installer Community
DeadlyDonger
Posts: 19
Joined: Wed Jan 07, 2015 6:44 pm

Script not running.

I've created a .vbs Script which reads a registry key which the Installer adds and then sets the read value at the end of the installation when the user checks the Checkbox and clicks the finish buttons. The script runs fine locally when doubled clicked. I've added the file using Launch attached file without sequence.

For the Checkbox, I've set a Published Event on the 'Finish' button. It goes: Execute Custom Action. I've selected the .vbs file for the Argument and for the condition I've added AI_INSTALL AND CHECK. After going through the installation, I check the checkbox and click the finish button but nothing in the registry (under HKLM) gets changed leading to the script not running in the installation when checked and button clicked finish.

I've also added another .vbs script to make it run under the uninstall processes ONLY and even that is not running. Either of these scripts aren't running when they are supposed to.

What's the problem here?
Dan
Posts: 4530
Joined: Wed Apr 24, 2013 3:51 pm

Re: Script not running.

Hello,

Please note that you need administrative privileges when making changes under HKLM registry hive. The custom action without sequence can be only set as immediate actions which does not have administrative privileges.

Since you need administrative privileges, you can use the Launch file custom action and enable the Run As Administrator flag.

Also, in order to have a better view about this, can you please send us the .AIP (project file) and a verbose log of the installation process to support at advancedinstaller dot com so we can investigate it? If it contains confidential information you can send us a small test project which reproduce this behavior.

Let us know if that helped.

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
DeadlyDonger
Posts: 19
Joined: Wed Jan 07, 2015 6:44 pm

Re: Script not running.

Dan wrote:Hello,

Please note that you need administrative privileges when making changes under HKLM registry hive. The custom action without sequence can be only set as immediate actions which does not have administrative privileges.

Since you need administrative privileges, you can use the Launch file custom action and enable the Run As Administrator flag.

Also, in order to have a better view about this, can you please send us the .AIP (project file) and a verbose log of the installation process to support at advancedinstaller dot com so we can investigate it? If it contains confidential information you can send us a small test project which reproduce this behavior.

Let us know if that helped.

Best regards,
Dan
Thank you Dan, Looks like the Launch File method worked.
DeadlyDonger
Posts: 19
Joined: Wed Jan 07, 2015 6:44 pm

Re: Script not running.

Sorry, Dan, if you're still there, or for anyone who knows, I have a little problem. I'm running a .bat file which is supposed to read a Registry value which the installer adds, use that read value and run another command using that value. Firstly I can confirm that the .bat file, running as admin, works externally but It won't run inside the installer, even though the Run as Admin is ticked. So I've got a checkbox which makes this .bat file run. Once I check the checkbox and click the finish button the .bat file is supposed to run. Basically the end result is blank value. I can confirm this because the registry HKCR\txtfile\shell\open\command the value is empty. This means that something is happening but not completing. I can confirm that the registry keys created by the installer exist when I reach the end finish dialog. What's the problem here? for those interested in the .bat file:

Code: Select all

@echo off
FOR /F "skip=2 tokens=2,*" %%A IN ('reg.exe query "HKLM\Software\Program" /v "FileOpenParam"') DO set "DFMT=%%B"
FTYPE txtfile=%DFMT%
exit
Dan
Posts: 4530
Joined: Wed Apr 24, 2013 3:51 pm

Re: Script not running.

Hello,

I'm not sure why you encountered this behaviour.
In order to have a better view about this, can you please send us the .AIP (project file) to support at advancedinstaller dot com so we can investigate it? If it contains confidential information you can send us a small test project which reproduce this behaviour.

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
DeadlyDonger
Posts: 19
Joined: Wed Jan 07, 2015 6:44 pm

Re: Script not running.

Dan wrote:Hello,

I'm not sure why you encountered this behaviour.
In order to have a better view about this, can you please send us the .AIP (project file) to support at advancedinstaller dot com so we can investigate it? If it contains confidential information you can send us a small test project which reproduce this behaviour.

Best regards,
Dan
Hi Dan,
I've just sent the test project.
taurus_ashwini
Posts: 17
Joined: Fri Dec 11, 2015 10:51 am

Re: Script not running.

Hi,

Looks like I am facing a similar problem.

Requirement Statement: Need to open a URL when a check box in exit dialog is checked and finish button is clicked.

Problem statement: Have a custom action openURL which works fine on click of a button. So no problem with the custom action.
Same custom action I am trying to invoke in the published events of the finish button when the check box in that dialog is checked.But I guess the installer is forcefully closing all the custom action threads.

Help: Need a work around for this. Where I can wait for the custom action to complete,

Attached: AIP file and log
Attachments
ExitDialogLog.log
(96.87 KiB) Downloaded 378 times
ExitWithLaunchURL.aip
(11.4 KiB) Downloaded 423 times
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Script not running.

Hello,

This happens because you are using a wrong condition for your execute action event. Please use the following condition for your "Execute cusom action -> OpenUrl" event:

Code: Select all

CHECKBOX_1_PROP
If you have any questions let us know.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”