waspy
Posts: 64
Joined: Fri Oct 03, 2008 10:58 am

Check target path question

Hello guys,
Can anybody advise me how to check for the file existance of a particular version when a user just selects installation directory and presses next button? I was thinking about subscribing to a CheckTragetPath event of the "next" button, but I cannot find any explanation of the control events and their arguments in the user manual. Any suggestions?

P.S. Would it be possible to include the description of the events and all accessable properties in the next version of the user manual?
P.S. (2) I also noticed that it is very inconvenient to use search on the forum - most of the time it returns an error that word(s) is used too often and returns no results. I cannot find any similar questions if there were any :cry:.

Thank you very much,
Alex
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Check target path question

Hi Alex,
Can anybody advise me how to check for the file existance of a particular version when a user just selects installation directory and presses next button?
I'm afraid that this is not supported by Windows Installer or by Advanced Installer. However, you can try using a custom action through a DoAction control event. You can find some sample VBScript code here. The installation path set by the user is stored in the APPDIR property and it can be accessed inside the custom action. For example, in VBScript you can use Session.Property:

Code: Select all

Dim installPath
installPath = Session.Property("APPDIR")
Would it be possible to include the description of the events and all accessable properties in the next version of the user manual?
I have added this improvement on our TODO list and it will be available in a future version of Advanced Installer. Thank you for your suggestion. Unfortunately we cannot include the improvement in the next version because it will be released in a couple of days.
I also noticed that it is very inconvenient to use search on the forum - most of the time it returns an error that word(s) is used too often and returns no results. I cannot find any similar questions if there were any
Unfortunately the forum search engine has some limitations. However, you can try using the search from our User Guide page (it will return results from the User Guide and from the forum).

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
waspy
Posts: 64
Joined: Fri Oct 03, 2008 10:58 am

Re: Check target path question

Thank you very much Cosmin.
One small thing: How can I terminate installation and rollback from VBScript if the file version is incorrect or not found?
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Check target path question

Hi,

This can be done by using a function inside the VBScript. Based on the results you obtain inside the custom action, you can set the function to one of the supported custom action return values. You can find a sample custom action here:
http://www.advancedinstaller.com/forums ... f=2&t=8593

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”