Noob I'm afriad - Advanced Installer Community

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!

bloke
Posts: 8
Joined: Tue Sep 26, 2006 4:05 pm

Noob I'm afriad

Hi all,

Sorry about such a noob question but I'm evalating this product and am banging my head against the wall trying to do the simplist thing :oops:
  • I need to check if a registry value exist and ONLY continue the install if it does.

    If it does exist, then it holds the value of a path I'd like to use as the install directory
I've tried several things to do this but can't seem to get it working.

If anyone could shed some light on it I'd be very gratful

Many thanks
bloke
Posts: 8
Joined: Tue Sep 26, 2006 4:05 pm

erm ok, it helps if you set the registry root properly in a search... muppet :oops: :lol:

I thought i was doing everything else ok as it's pretty intuitive, but didn't know how to debug the value being returned. Hey ho

OK, let me ask another question then......

How can I do string manipulation on this value, and still use it as the destination directory - say I wanted to trim or replace?

Many thanks
gigi
Posts: 2103
Joined: Tue Apr 11, 2006 9:55 am
Contact: Website

Hi,

The path where the package will be installed is given by the APPDIR property. This property can be set by the user on the "FolderDlg" dialog. To avoid the user to set the path form UI remove this dialog.

Now you need to create a registry search in the "Search" page and browse for the key in the registry. The result of the search is stored in the "RESULT_PROPERTY" by default. Switch to "Custom Actions" page and create a "Directory Set With Formated" custom action under "InstallExecuteSequence->CostFinalize" standard action (to make "CostFinalize" visible click on the "Show Standard Action" toolbar button).

In the "Directory" field browse for the APPDIR folder. In the "Formated Text" filed type [RESULT_PROPERTY].

Hope this helps.

Regards,
Gigi
_______________
Gheorghe Rada
Advanced Installer Team
http://www.advancedinstaller.com
bloke
Posts: 8
Joined: Tue Sep 26, 2006 4:05 pm

Hi Gigi,

Thanks for that. It goes some way to answering my question but was wondering if you could give a few finer details please:

How can I manipulate the value of "RESULT_PROPERTY" before assigning it to APPDIR in the custom action?

Suppose the value of "RESULT_PROPERTY" was a path but had file.exe tagged on the end of it - how would I trim it. Would I have to execute a VBS script before assigning it, and can I pass the value of "RESULT_PROPERTY" into the script as a parameter and update the Installer value from it's result? :?

Also, if I leave the "FolderDlg" in, at what point would I do the Custom Action in order to have it's default path as the manipulated one?

Hope that makes sense... I've only had 2 cups of coffee this morning :)

Many thanks
gigi
Posts: 2103
Joined: Tue Apr 11, 2006 9:55 am
Contact: Website

Hi,

You can manipulate a property in the VBS custom action like this:
1. Get its value:

Code: Select all

var = Session.Property("RESULT_PROPERTY")
2. Set its value:

Code: Select all

Session.Property("RESULT_PROPERTY") = var
Also, if I leave the "FolderDlg" in, at what point would I do the Custom Action in order to have it's default path as the manipulated one?
To do this you need to schedule all your custom actions under "InstallUISequance->CostFinalize".

Regards,
Gigi
_________________
Gheorghe Rada
Advanced Installer Team
http://www.advancedinstaller.com
bloke
Posts: 8
Joined: Tue Sep 26, 2006 4:05 pm

Excellent thanks, that should keep me busy for a bit.

Thanks for your help. If I can get this all working properly you may well of secured yourself a sale ;)

Return to “Common Problems”