crmiller87
Posts: 9
Joined: Wed Jan 09, 2013 12:30 am

How to use custom search results

I am having trouble finding documentation/examples on how to use the search feature during the installation.
I created a search that finds a registry key: SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{8B003F54-E7EB-45B7-9FC5-1C5D6A4005F9}_is1
The search result returns: 1: "C:\Program Files (x86)\ApplicationName\unins000.exe" /SILENT

My objective is to run this returned "string" using cmd.exe but it is unclear to me how to make this happen. Thank you in advance

Colin
Eusebiu
Posts: 4931
Joined: Wed Nov 14, 2012 2:04 pm

Re: How to use custom search results

Hi Colin,

In order to achieve what you want you can use the "Launch file from property" custom action from the Custom Actions page.

Let us know if it helped, otherwise give us more details about your scenario.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
crmiller87
Posts: 9
Joined: Wed Jan 09, 2013 12:30 am

Re: How to use custom search results

Hi Eusebiu,

Thank you, that got me to the next step but I am still not there 100%. I changed things up a bit in my search. Please see attached screenshot1.png. The search now returns the installation directory of the program I want to uninstall. Inside the directory, there is a file called "unins000.exe". When I run the test of the search it returns: 1: C:\Program Files (x86)\ProgramName\

In the Custom Actions section, I added a "Launch file from property" like you said, but I am unclear on what needs to be filled in for the parameters. Please see attached screenshot2.png. The current configuration does not run the .exe as I expect so I must be doing something wrong. Thanks again

Colin
Attachments
screenshot2.png
screenshot2.png (81.27 KiB) Viewed 8329 times
screenshot1.png
screenshot1.png (20.48 KiB) Viewed 8329 times
Eusebiu
Posts: 4931
Joined: Wed Nov 14, 2012 2:04 pm

Re: How to use custom search results

Hi Colin,

You can try to modify the next settings in your project:
- in your custom action properties clean the "unins000.exe" parameter from the "Command" text field
- in the search properties change the type of the search ("Retrieve the raw value" instead of "The value contains a path to a directory") and select the registry value that points to "unins000.exe"
Build and run the project.

Let us know if it helped.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
crmiller87
Posts: 9
Joined: Wed Jan 09, 2013 12:30 am

Re: How to use custom search results

Hi Eusebiu,

I tried your changes. The raw value that is returned is "1: "C:\Program Files (x86)\ApplicationName\unins000.exe"" but the execution still does not occur. Here is what the log says

Action start 10:41:17: LaunchFileFromProperty.
MSI (s) (40:BC) [10:41:17:854]: Note: 1: 1721 2: LaunchFileFromProperty 3: "C:\Program Files (x86)\ApplicationName\unins000.exe" 4: Info 1721.
There is a problem with this Windows Installer package.
A program required for this install to complete could not be run.
Contact your support personnel or package vendor.
Action: LaunchFileFromProperty, location: "C:\Program Files (x86)\ApplicationName\unins000.exe", command: Action ended 10:41:17: LaunchFileFromProperty. Return value 1.

It doesn't really describe what is failing, any ideas? Or maybe look somewhere else in the log?
Eusebiu
Posts: 4931
Joined: Wed Nov 14, 2012 2:04 pm

Re: How to use custom search results

Hi Colin,

Sorry, but I forgot to mention that the "Launch file from property" custom action cannot launch a package if the "When the system is being modified (deferrer)" and "Run under the LocalSystem account with full privileges (no impersonation)" options are not checked.

Also, to be able to check these options it must be placed below the "Preparing" action group.

In order to be able to launch your file below the "Searches" action group, you can use the "Launch file or open URL" custom action.

In the "Command" text field you need to write your property between quotes (i.e. "[OLD_VERSION_SEARCH]"). Besides the options I mentioned for the "Launch file from property" custom action doesn't need to be checked anymore.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
crmiller87
Posts: 9
Joined: Wed Jan 09, 2013 12:30 am

Re: How to use custom search results

Okay I moved "Launch file from property" below "Preparing" and then checked the options you stated. Then I added a "Launch file or open URL" custom action and placed it below "Searches". Here is what they both look like now but still no success. I've also attached the log file
LaunchFileOrURL.png
LaunchFileOrURL.png (57.3 KiB) Viewed 8305 times
LaunchFileFromProperty.png
LaunchFileFromProperty.png (72.79 KiB) Viewed 8305 times
Attachments
installation.log
(418.88 KiB) Downloaded 357 times
Eusebiu
Posts: 4931
Joined: Wed Nov 14, 2012 2:04 pm

Re: How to use custom search results

Hi,

Please verify that the uninstall process called by your custom action does not conflict with the current installation process (this usually happens when two MSI packages try to run at the same time).

Also, you can use only one of the "Launch file or open URL" and "Launch file from property" custom action, it is not necessarily to use them both. In your case they do actually the same thing.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
crmiller87
Posts: 9
Joined: Wed Jan 09, 2013 12:30 am

Re: How to use custom search results

Hi Eusebiu,

I took out the "Launch file from property" and left "Launch File or URL" in there. However I found out that putting double quotes around [OLD_VERSION_SEARCH] was not working so I tried taking them out and it works now. Thank you for sticking with me and helping me get this to work

Colin
Eusebiu
Posts: 4931
Joined: Wed Nov 14, 2012 2:04 pm

Re: How to use custom search results

You're welcome. I'm glad you got this working.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”