Epsilon
Posts: 25
Joined: Wed Dec 27, 2006 1:09 am
Location: New Zealand
Contact: Website

Search Registry does not return Raw Value

Hi

I am using Advanced Installer to create installation packages for Microsoft Access applications.

I have a set of Searches defined which look in the Registry for the following key: HKLM\SOFTWARE\Microsoft\Office\xx.0\Access\InstallRoot
where xx.0 is the Version of Access: 12.0 for Access 2007, 14.0 for Access 2010 and 15.0 for Access 2013.

When I run the install on a Windows 7 (64-Bit) PC with Access 2013 (32-Bit) installed the Registry Key contains "C:\Program Files\Microsoft Office 15\root\Office15\" but the search returns "C:\Program Files (x86)\Microsoft Office 15\root\Office15\". Even though the Registry Editor shows the value correctly and Access 2013 is installed in folder "C:\Program Files\Microsoft Office 15\root\Office15\", the AI search returns the value with ' (x86)' after the 'Program Files' folder name.

Why is AI returning an incorrect raw value?

The shortcut created by the installation then fails to run because the Access 2013 program does not exist in the 'Program Files (x86)' folder.

Cheers

Richard Williams
Dan
Posts: 4530
Joined: Wed Apr 24, 2013 3:51 pm

Re: Search Registry does not return Raw Value

Hello Richard,

Can you please try to enable the Search the 64-bit portion of the registry option from the “Search properties” and see if the behavior still persist?

Please let us know if that helped.

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Epsilon
Posts: 25
Joined: Wed Dec 27, 2006 1:09 am
Location: New Zealand
Contact: Website

Re: Search Registry does not return Raw Value

Hi Dan

Thanks for your prompt reply.

I have already tried that but the Search returns nothing,

The Access 2013 program is the 32-bit version and so the Registry Key I want is in the Wow6432Node branch. I'm not sure why Access isn't installed in the 'Program Files (x86)' folder but that is just the way the Office installer did it, I had no option to change it.

The bottom line is that when I look under 'Wow6432Node\Microsoft\Office\15.0\Access\Installroot' I see the 'Path' string with a value of 'C:\Program Files\Microsoft Office 15\root\Office15\' but AI returns the value 'C:\Program Files (x86)\Microsoft Office 15\root\Office15\'.

I have just tried another Search where I do check 'Search the 64-bit portion of the registry' but also modify the Search to look for 'Path' in 'HKLM\SOFTWARE\Wow6432Node\Microsoft\Office\15.0\Access\Installroot' and this time it does return the value I want. Perhaps that is the way to go but I still think there must be a problem with the way AI is doing the search.

Cheers

Richard
Dan
Posts: 4530
Joined: Wed Apr 24, 2013 3:51 pm

Re: Search Registry does not return Raw Value

Hi Richard,

I've tested and investigated your scenario and unfortunately this is the standard Windows Installer behavior when you are using a 32-bit package type.

The AppSearch standard action redirect all the 64-bit paths from searches results to 32-bit paths if you are using a 32-bit package type. However, as a workaround you can use a "Mixed 32/64-bit Package" type or you should create your own custom action which will edit accordingly the related property (which stores the search result). Also, the custom action should be scheduled after "Wizard Dialogs Stage -> Searches" and "Install Execution Stage -> Searches" action group.

If you have other questions, please let us know.

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
p35t173nc3
Posts: 33
Joined: Wed Apr 02, 2008 1:20 pm

Re: Search Registry does not return Raw Value

Please help, i have this exact problem but I am using a Mixed Package Type...
Dan
Posts: 4530
Joined: Wed Apr 24, 2013 3:51 pm

Re: Search Registry does not return Raw Value

Hi,
Please help, i have this exact problem but I am using a Mixed Package Type...
Can you please give us more details about your specific scenario? Also, can you please send us the .AIP (project file) to support at advancedinstaller dot com so we can investigate it?

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
p35t173nc3
Posts: 33
Joined: Wed Apr 02, 2008 1:20 pm

Re: Search Registry does not return Raw Value

Hello, ok that problem I figured out - the UI was not actually changing the Package Type. I have lots of builds and it had something to do with that. I just tried and tried again and eventually it changed them all to the correct PackageType...

But now I have another problem and it is driving me nuts... I will start a new post.
Epsilon
Posts: 25
Joined: Wed Dec 27, 2006 1:09 am
Location: New Zealand
Contact: Website

Re: Search Registry does not return Raw Value

Thanks (Dan) for your reply back on the 9th October 2013.

I have now had a chance to try out your suggestion and it works well. What I have done is added a Custom Action using the Execute inline script code option. This checks the Property I have put the Registry result into and adjusts this to refer to the correct 32-Bit Path using the Session object.

The VBScript I have written is fairly complex and, since I have a number of Installation packages, I decided I would rather put this into an external file and use the Launch attached file option instead. This means I only have to change the script in the external file and then rebuild all of my packages in order to incorporate any changes.

My question now is: How do I refer to the Session object?

When the script executes the line:

Code: Select all

stACCESS = Session.Property("Access15")
I get a Runtime error because the Session object does not seem to be available in the script. Your Help file states that
The installer attaches the Session Object to the script with the name "Session"
but there is no mention of the Session object in the Launch attached file option.

Is there something else I have to do to declare the Session object?

I am using Advanced Installer V10.5.2

Cheers

Richard
Dan
Posts: 4530
Joined: Wed Apr 24, 2013 3:51 pm

Re: Search Registry does not return Raw Value

Hi Richard,

I'm not sure why you encountered this behavior.
In order to debug your custom action you can take a look on the How do I debug my .VBS custom action and Why does my VBScript custom action fail to run? articles with related information for hints and guidance.
Also, make sure that your custom action is not set as deferred since the deferred custom actions do not have access to installer properties.

Please note that we recommend you to use a DLL custom action for example, you can create your custom action as a custom action written in C# or a custom action written in C++, instead of VBScript and you can see some reasons why not to use VBScript .

Then you can go in the “Custom Actions” page and add a predefined Launch attached file custom action with sequence. This type of custom action can execute an application (EXE or DLL) or run a script (VBScript or Java script). Also, the source file will be embedded in the MSI file but will not be deployed at install time with the other application files.

Please let us know if that helped.

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Epsilon
Posts: 25
Joined: Wed Dec 27, 2006 1:09 am
Location: New Zealand
Contact: Website

Re: Search Registry does not return Raw Value

Hi Dan

Thanks for your prompt reply.

While I can appreciate your preference for DLL as opposed to using a VBScript, you have not actually answered my question at all.

I would like to know whether a VBScript file used as the file in a Launch attached file Custom Action can make use of the Session object to access the Properties of the installation. If so, what syntax do I use to create a reference to the Session object?

Before I investigate any other option I need to know the answer to this question.

Also note that my Custom Action is declared as immediate not deferred.

Cheers

Richard
Dan
Posts: 4530
Joined: Wed Apr 24, 2013 3:51 pm

Re: Search Registry does not return Raw Value

Hi Richard,

Yes, you can use the Session object to access the Properties of the installation package through a VBScript file in a launch attached file custom action.
I've attached a .zip file which contains a sample that implements your scenario.

Please let me know if that helped.

Best regards,
Dan
Attachments
LaunchVBS script - GetAPPDIR value.zip
(2.66 KiB) Downloaded 772 times
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Epsilon
Posts: 25
Joined: Wed Dec 27, 2006 1:09 am
Location: New Zealand
Contact: Website

Re: Search Registry does not return Raw Value

Hi Dan

Thanks for you reply. I have now successfully used an external file.

I think the problem was that I was using the Function field when all I needed to do was leave this blank and let the script run as it had done when used in-line.

The next question is, taking into account your previous comments about avoiding using VBScript/JScript for Custom Actions is, how do I refer to the Session Object from an EXE file?

Cheers

Richard
Dan
Posts: 4530
Joined: Wed Apr 24, 2013 3:51 pm

Re: Search Registry does not return Raw Value

You're welcome Richard,
The next question is, taking into account your previous comments about avoiding using VBScript/JScript for Custom Actions is, how do I refer to the Session Object from an EXE file?
Please note that using an .EXE custom action has many drawbacks, since your cannot set a installer property through an .EXE custom action.
We recommend you to use a DLL custom action for example, you can create your custom action as a custom action written in C# or a custom action written in C++.

Then you can go in the “Custom Actions” page and add a predefined Launch attached file custom action. This type of custom action can execute an application (EXE or DLL) or run a script (VBScript or Java script). Also, the source file will be embedded in the MSI file but will not be deployed at install time with the other application files.

In order to retrieve the value of a property, you can use the MsiGetProperty function for C++ or Session.GetProperty function for C#.

If there is anything else I can help with, please let me know.

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”