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!

dsc
Posts: 14
Joined: Fri Mar 29, 2013 3:01 pm

Registry Search - Conditional Install - Issue

Hello,
My company just purchased Advanced Installer 10 Enterprise and I've been tasked to learn and build an installer for a project. The requirements of the installer are as follows:

- Check the registry for 3 different values.
- Use the values from the search for a conditional logic (If X, Y and Z = 1, perform file copy from location A to program dir).
- Based on the conditional results, copy files from location A to program dir.

After reading through the forums and documentation, I have gathered the following sequence:

Use the Custom Behavior Search function to search for one of the registry values which will be the search result used in the Organization Condition field to determine which file is copied. The challenge I'm running into is when defining the registry value; when I use the "New Search" wizard and get to the point where I select the "Key" using the "..." button the field doesn't update with my selection and if I type it in, the search test fails. Also, where do I define what directory the files should be copied to based on the conditional value results? Any help would be appreciated.

Thanks,
Derek
dsc
Posts: 14
Joined: Fri Mar 29, 2013 3:01 pm

Re: Registry Search - Conditional Install - Issue

I should also mention this is a silent install for a remote deployment.
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Registry Search - Conditional Install - Issue

Hello Derek and welcome to Advanced Installer forums,

Thank you for your interest in Advanced Installer.

In order to achieve what you want you can use a file copy operation based on a registry search result.

Also, you can take a look on our "Wow6432Node Registry Key" article which could be useful for you.

Let us know if this helped, otherwise please give us more details about your scenario (maybe exemplify).

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
dsc
Posts: 14
Joined: Fri Mar 29, 2013 3:01 pm

Re: Registry Search - Conditional Install - Issue

Hi Daniel,
Thanks for the response. I reviewed your recommendations and have a few followup questions:

- For the File Copy Operation, from what I have read, this is for files that would reside on the remote machine, not within the installer package, correct? The files that would need to be deployed would reside in the installer.

- I'm building the installer on a Win7 64 bit machine and the machines where the installer would be running would be on a 32bit XP machine, is there any issue with this?

The example for the installer is as follows:

Remotely deploy the installer to machine X.
Invoke the silent installer to do the following:
- The installer would contain the files that need to be deployed.
- The installer would check the registry for 3 values.
- Based on the values found, conditional logic would be used to copy the files within the installer to a specific directory on the remote machine.

Thanks
dsc
Posts: 14
Joined: Fri Mar 29, 2013 3:01 pm

Re: Registry Search - Conditional Install - Issue

Bumping this up with the update provided below.
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Registry Search - Conditional Install - Issue

Hello,
- For the File Copy Operation, from what I have read, this is for files that would reside on the remote machine, not within the installer package, correct? The files that would need to be deployed would reside in the installer.
Yes, this is correct.
- I'm building the installer on a Win7 64 bit machine and the machines where the installer would be running would be on a 32bit XP machine, is there any issue with this?
No, there should be no problem.
The example for the installer is as follows:

Remotely deploy the installer to machine X.
Invoke the silent installer to do the following:
- The installer would contain the files that need to be deployed.
- The installer would check the registry for 3 values.
- Based on the values found, conditional logic would be used to copy the files within the installer to a specific directory on the remote machine.
In order to achieve what you want you can proceed like this:
- Go to "Install Parameters" page and add a property like this:
  • Name: MY_PROP
    Value: Your Value
- Go to "Files and Folders" page, create a property-based folder using the above property and add your files in it.
- Go to "Search" page and add your registry search (MY_SEARCH).
- Go to "Custom Actions" page and add a "Set installer property" custom action with sequence, scheduled after "Wizard Dialogs Stage -> Searches" action group, like this:
  • Property: MY_PROP
    Formatted: [APPDIR]
    Condition: MY_SEARCH = "application folder"
- Select the above custom action and while keeping SHIFT key pressed drag it under "Install Execution Stage -> Searches" action group.
- Build and run your project.

Also, you can take a look on our "Folder Paths" article which could be useful for you.

Let us know if this helped.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
dsc
Posts: 14
Joined: Fri Mar 29, 2013 3:01 pm

Re: Registry Search - Conditional Install - Issue

Hi Daniel,
Thanks for the feedback. The steps you described almost get me there, the issue is with conditional logic based on the registry value. I'm doing a search against HKLM/SOFTWARE/COMPANYNAME/REG_SV = X. When I set the condition in the custom action page to "Windows Installer Property" -> then set the condition to the search property above and set the value = to X. When I do a validate against this it always returns a true condition even when the value is set to Y which incorrectly copies the wrong files. Am I doing something wrong with the Registry Search?

Thanks
dsc
Posts: 14
Joined: Fri Mar 29, 2013 3:01 pm

Re: Registry Search - Conditional Install - Issue

Bumping this up again.
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Registry Search - Conditional Install - Issue

Hello,

I'm not sure why this happens. Can you use a condition like this:

Code: Select all

SEARCH_PROPERTY_NAME = "X"
and see if the behavior still persist? If so, can you please send us the the .AIP (project file) and a verbose log of the installation to support at advancedinstaller dot com so we can investigate them?

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
dsc
Posts: 14
Joined: Fri Mar 29, 2013 3:01 pm

Re: Registry Search - Conditional Install - Issue

Hi Daniel,
My conditional logic is exactly how you have it below but it returns a Valid result each time even when the condition is false. Is there a way to see what the results are when doing a test on the registry search as it doesn't display anything, I just see the exe window come up the go away. Also, I'm trying to retrieve the raw value of the key to be used in the conditional statement, this is possible, correct?

I tried running the install via MSIEXEC but I get an error " This installation package could not be opened. Contact the application vendor..."

When I double click the EXE it installs though so I can't provide the verbose log. I will email the .aip for review.

Thanks
dsc
Posts: 14
Joined: Fri Mar 29, 2013 3:01 pm

Re: Registry Search - Conditional Install - Issue

Also, just curious, is there a way to manually script all of this within the installer itself or is scripting done in an outside language (C#,JS, batchscript, etc)?
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Registry Search - Conditional Install - Issue

Hello,
My conditional logic is exactly how you have it below but it returns a Valid result each time even when the condition is false. Is there a way to see what the results are when doing a test on the registry search as it doesn't display anything, I just see the exe window come up the go away.
In order to achieve this you can use a "Execute inline script code" custom action with sequence, scheduled after your "UR_GOLD" custom action, like this:
  • Script Text: MsgBox Session.Property("GOLD_UR_PARM")
Also, please keep in mind that when your installation package is running with Full UI, searches from "Search" page are performed during "Wizard Dialogs Stage" -> "Searches" -> "AppSearch" standard action. If your installation package is running without Full UI, then searches from "Search" page are performed during "Install Execution Stage" -> "Searches" -> "AppSearch" standard action. So, your "UR_GOLD" custom action should be added after "Wizard Dialogs Stage -> Searches" and after "Install Execution Stage -> Searches" action group.

Also, can you please specify to which folder path you want to redirect your "GOLD_UR_PARM" property-based folder when your registry search condition is fulfilled?
Also, I'm trying to retrieve the raw value of the key to be used in the conditional statement, this is possible, correct?
Yes, for this you can use a registry search.
Also, just curious, is there a way to manually script all of this within the installer itself or is scripting done in an outside language (C#,JS, batchscript, etc)?
In order to achieve this you should develop your own custom action outside of installer.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
dsc
Posts: 14
Joined: Fri Mar 29, 2013 3:01 pm

Re: Registry Search - Conditional Install - Issue

Hey Daniel,
So, your "UR_GOLD" custom action should be added after "Wizard Dialogs Stage -> Searches" and after "Install Execution Stage -> Searches" action group.
I went through and added the custom action "UR_GOLD" to the sections below as described but it still is copying the files to the folder when the registry condition is false.
Also, can you please specify to which folder path you want to redirect your "GOLD_UR_PARM" property-based folder when your registry search condition is fulfilled?
Under the "Install Parameters" -> Properties section I added a property with the custom path to C:\XPS\Parm. I then created a property based folder and added the files that needed to be copied. Then I added a "Custom Actions" -> "Set Installer Property". The property that is set is the folder property and the condition is the registry search.

Were you able to review the .aip file that I emailed?

Thanks
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Registry Search - Conditional Install - Issue

Hello,
Under the "Install Parameters" -> Properties section I added a property with the custom path to C:\XPS\Parm. I then created a property based folder and added the files that needed to be copied.
Using this scenario the files added in your property-based folder will be installed in the following location on target machine:

Code: Select all

C:\XPS\Parm
Also, if you want to change the above location during install based on a condition (i.e. registry search) then you can add a "Set installer property" custom action like this:
  • Property: GOLD_UR_PARM
    Formatted: [APPDIR] (if you want to install the related files in the application folder when SEARCH_PROPERTY_NAME = "X")
    Condition: SEARCH_PROPERTY_NAME = "X"
If the above condition is not fulfilled, then the property-based folder will be resolved to its initial path (C:\XPS\Parm).

Let us know if this helps, otherwise please give us a detailed step by step description of the scenario you are trying to achieve.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
dsc
Posts: 14
Joined: Fri Mar 29, 2013 3:01 pm

Re: Registry Search - Conditional Install - Issue

Hi Daniel,
Below is the step by step scenario:

Folder structure within the MSI:
GOLD_UR:
-> 10_DYNAKEY_ALL (Folder - only select files)
-> 20_TOUCH_BC (Folder - only select files)
-> 30_TOUCH_UR (Folder - only select files)
-> 40_GOLD_BC (Folder - only select files)
82 unique files within the GOLD_UR folder.

- This is a silent install deployed to remote machines, no user intervention.
- Two Regkey's exist on the remote machine:
-> Hardware_Type: Touch or Dynakey
-> Config_Type: UR or BC

-Conditional logic for the following:
-> Check Config_Type:
-> IF Config_Type = BC, copy 82 files from GOLD_UR, then copy files from 40_GOLD_BC to C:\XPS\PARM
-> IF Config_Type = UR, copy 82 files from GOLD_UR to C:\XPS\PARM
AND
-> Check Hardware_Type:
-> IF Hardware_Type = TOUCH and Config_Type = UR, copy files from 30_TOUCH_UR to C:\XPS\PARM
-> IF Hardware_Type = TOUCH and Config_Type = BC, copy files from 20_TOUCH_BC to C:\XPS\PARM
-> IF Hardware_Type = DYNAKEY, copy files from 10_DYNAKEY_ALL to C:\XPS\PARM

Punch Registry with the installer version number - doesn't need to be installed under program files or in the control panel under programs. Thoughts on how this can be done?

Return to “Building Installers”