64-Bit problem with custom actions - Advanced Installer Community
jusher
Posts: 195
Joined: Thu Dec 22, 2011 12:00 pm

64-Bit problem with custom actions

Hi Everyone,
Long time no message!

First of all if I create a 64 bit project and add a custom action should that custom action have the correct type inserted into the database? It seems to have put a 6 in the type. The custom action in question is ran as part of a modify. The install is ok in that it puts the information in the correct place under HKEY_LOCAL_MACHINE i.e. not in the WOW6432Node. However when I come to retrieve the data (a directory location) it looks in the WOW6432Node and cannot find it. I proved this by putting the requisite keys in the WOW6432Node. I then discovered that to run a script as 64bit it should have a different type in the database as per: -
Custom action types: -

http://msdn.microsoft.com/en-us/library ... s.85).aspx
Type 6 is a VBScript.vbs file BUT on a 64 bit system you need type 4102! According to: -

http://msdn.microsoft.com/en-us/library ... s.85).aspx
editing this type into the table for this custom action made the Modify operation work i.e. it looked in the 64 bit part of the registry for the data.

Why when I remove and reinsert the CA does it not change the type to 4102?

Hope this makes sense. I have not experienced the error I am getting with this CA in previous 64 bit versions maybe I have just been lucky!

Thoughts,
John
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: 64-Bit problem with custom actions

Hi there John, welcome back!

How you retrieve data inside the custom action(s) is completely based on the intended functionality. Indeed you should consider 32/64 bit locations and perhaps create a custom action for each target machine architecture.
To run a custom action based on the Windows OS type (32-bit or 64-bit) is fairly simple. This can be done by using the VersionNT64 property in the "Execute Stage Condtion" -> "Condition" field of a custom action.

For the custom action to run only on a 32-bit system, the condition is:

Code: Select all

NOT VersionNT64
For the custom action should to run only on a 64-bit system, the condition is:

Code: Select all

VersionNT64
All the best,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
jusher
Posts: 195
Joined: Thu Dec 22, 2011 12:00 pm

Re: 64-Bit problem with custom actions

Hi Mihai,

The CA does a check on a global as to whether the OS_Type is 64 or 32 bit. My point is that when I want to use a CA in a 64 bit project I shouldn't have to change the table for the type i.e. 6 = 32 Bit and 4102 = 64 bit. Surely the AI application should decide that for me? The default on a 64 bit project I would presume would be 64 bit CA. instead the default is 6. Which now means I need to alter the CustomAction table.

Thoughts,
John
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: 64-Bit problem with custom actions

Hi John,

The .MSI can't be altered dynamically after the installation has started. This is why Windows Installer doesn't support mixed type installations and our team implemented the possibility by launching a .MSI package depending on the machine architecture (32 or 64-bit).
The default on a 64 bit project I would presume would be 64 bit CA. instead the default is 6.
The default is not package type dependent. The custom action type (32 or 64-bit) can be changed from the custom action's "File Type" combo box. 32-bit custom actions can be executed on 64-bit machines as well.

I will reinforce my previous suggestion as a guideline. To install resources in the correct locations you have to use separate custom actions.

All the best,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
jusher
Posts: 195
Joined: Thu Dec 22, 2011 12:00 pm

Re: 64-Bit problem with custom actions

Hi Mihai,

Yes I see this now, I was unaware (or if I was I had forgotten) that there was a 64 bit type under File Type dropdown.

You guideline is a good one but I can still use my CA for both because I alter the correct registry locations based on a property that I have created to identify whether it is being 'called' by the 64 bit installation MSI or the 32 bit. It works well except for in this instance where I have not chosen the correct file type! For this one I have had to identify which product a particular customer has and delete by product code using msiexec. As it was looking in the wrong place the software was not being removed.
Obviously now you have enlightened me to the file type options this will solve my problem.

Thank you,
John

Return to “Common Problems”