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!

Jebrew
Posts: 53
Joined: Thu Jan 18, 2007 8:53 pm

Redo a search

Don't know if anyone else has asked this, but I couldn't find anything on it. I've got a string that I'm pulling from a registry entry that performs an action that removes said entry (as well as the files it points to) from the system. Problem is that when I have it tied to a button action I need to possibly change the text tied to that attribute. Easiest solution I can think of would be to have a way to re-run the search that grabbed the text in the first place. Is there any way to do that?

Just in case that was as brutally unclear as I think it might have been, let me try to explain in a few steps.
1. Get command line from registry (getting the command now and it works).
2. If the entry in the registry existed (i.e. the search came up with something other than ""), run the command (an uninstall).
3. If the registry entry no longer exists, change the result property from the search to the empty string, otherwise, leave it as it is.

I've got #1 and #2 working fine, it's #3 that's causing me some duress. Any ideas?

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

Hi,
3. If the registry entry no longer exists, change the result property from the search to the empty string, otherwise, leave it as it is.
I'm afraid that I don't fully understand what is the problem you encounter (since the result property is empty if the search fails).

Best Regards,
Gigi
______________
Gheorghe Rada
Advanced Installer Team
http://www.advancedinstaller.com
Last edited by gigi on Tue Feb 13, 2007 1:31 pm, edited 1 time in total.
gigi
Posts: 2103
Joined: Tue Apr 11, 2006 9:55 am
Contact: Website

Hi,

Could you please give me more details on step 3.

Regards,
Gigi
______________
Gheorghe Rada
Advanced Installer Team
http://www.advancedinstaller.com
Jebrew
Posts: 53
Joined: Thu Jan 18, 2007 8:53 pm

Sorry about the delay. So when the installer starts up it gets the value from the registry, from the welcome page, if the value is not the empty string, the command is run. The old uninstaller runs and removes said command from the registry, however the string in the AI installer still contains the now invalid command line, so if the user presses the back button and then presses the next button, the command is attempted and an error box pops up. I would like to have an action of some sort that attempts to read the value from the registry in the event the user presses the back button from my second dialog.

Hrm...my explanations aren't that great, hopefully that's good enough.

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

Hi Jebrew,

Here is a suggestion:

Add a "ScriptInLine" UI custom action (under "Custom Actions" page) with this code (this CA sets the property to empty string):

Code: Select all

Session.Property("SEARCH_PROPERTY") = ""
On the back button of the second dialog add a published event that execute the action added above like this:
Name: DoAction
Argument: ScriptInLine

Regards,
Gigi
______________
Gheorghe Rada
Advanced Installer Team
http://www.advancedinstaller.com
Jebrew
Posts: 53
Joined: Thu Jan 18, 2007 8:53 pm

That would work great, but now I need to compensate for the possibility that the previous install failed. If the uninstaller is still there, I don't want to remove the uninstall string. Actually, I'd like to fail the install if the uninstall fails. I think I can get by with just trying to detect the previous installation via the install directory. I would like a way to re-run a search though. If you could put that in your feature request, I'd appreciate it. Again, I can probably get by with just looking for the previous install, so it wouldn't be a top priority feature request.
Thanks,
Jebrew
gigi
Posts: 2103
Joined: Tue Apr 11, 2006 9:55 am
Contact: Website

Hi Jebrew,
If you could put that in your feature request, I'd appreciate it. Again, I can probably get by with just looking for the previous install, so it wouldn't be a top priority feature request.
All searches (created in "Search" page) are fully controlled by Windows Installer and are execute under "AppSearch" standard action. You can not re-run a search at a specific stage. If you really want to do that you need to use your own custom action that makes the search.

Best Regards,
Gigi
_______________
Gheorghe Rada
Advanced Installer Team
http://www.advancedinstaller.com

Return to “Common Problems”