Prerequisites - using properties in "Registry Key Exists" - Advanced Installer Community

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!

drivard
Posts: 50
Joined: Wed Dec 05, 2007 10:14 pm

Prerequisites - using properties in "Registry Key Exists"

Hi,
I'm trying to detect that one of our products is installed by checking a registry key.
We are using the template feature to white label our product for several vendors, and the registry name is dependent on the brand.
I've tried using a property as part of the check: HKCU\Software\[FOO_REGBASE_NAME]

That fails.
Using procmon and pressing "Test", you can see AI look for the literal string, rather than the expanded string...
I've also tried HKCU\Software\[|FOO_REGBASE_NAME] to no avail.

Is it possible to accomplish this? I'm hoping I don't have to hack the AIP file at build time.

thanks,
Dennis
Bogdan
Posts: 2796
Joined: Tue Jul 07, 2009 7:34 am
Contact: Website

Re: Prerequisites - using properties in "Registry Key Exists"

Hi,
I've tried using a property as part of the check: HKCU\Software\[FOO_REGBASE_NAME]
I'm afraid this is not possible, this field doesn't support using public properties.

The solution is the following, instead of searching for a specific registry entry you can use the criteria "Product Version (identify by Product Code)"
and specify the product code of your prerequisite. This product code should be found on all machines on which the prerequisite is installed.

Regards,
Bogdan
Bogdan Mitrache - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
drivard
Posts: 50
Joined: Wed Dec 05, 2007 10:14 pm

Re: Prerequisites - using properties in "Registry Key Exists"

Hi Bogdan,
ProductCode wouldn't work for me, because I don't necessarily care about the version that is installed.
I see that checking for UpgradeCode is available, and that would be perfect, if it allowed the use of properties. In fact, I like the idea of using UpgradeCode better than a registry key.
It does not appear that this field allows this however.

Other than hacking the AIP file at build time, do you have any other ideas?

Can you add the ability to use public properties to the wish list?

Just to review, my base AIP file is a template, and at build time, I use the /DuplicateProject option for each of the brandings that we have. Then I apply command files for each branding when building.
The use of properties is critical to our build process, because it allows us the ability to easily brand the installers.

thanks for your help,
Dennis
Bogdan
Posts: 2796
Joined: Tue Jul 07, 2009 7:34 am
Contact: Website

Re: Prerequisites - using properties in "Registry Key Exists"

Hi Dennis,
It does not appear that this field allows this however.
Other than hacking the AIP file at build time, do you have any other ideas? Can you add the ability to use public properties to the wish list?
I'm afraid you cannot use public properties in that field. This is an implementation restraint, that is why it wasn't implemented from the beginning.
Just to review, my base AIP file is a template, and at build time,....
The prerequisites must be added only once after you create the project, you don't need to always set them from the command line.

After you create all the projects you need to simply add the prerequisites from the user interface of Advanced Installer and save them.
Since a prerequisite doesn't changes every day I don't see any reason why you would want to edit them daily using the automated scripts.

Regards,
Bogdan
Bogdan Mitrache - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
drivard
Posts: 50
Joined: Wed Dec 05, 2007 10:14 pm

Re: Prerequisites - using properties in "Registry Key Exists"

Hi,
I think you didn't understand what I was getting at when describing our build. We keep one AIP file as the master template for each of our brandings (we have 5 customers, each with their own branding). At build time, we use the master to customize each installer for our customers. The pre-requisite has been added to the template AIP file, so it is copied to each branded AIP.

The issue is that the prerequisite is looking for a branded version of another product we make. We can't hard-code it, because it has a different UpgradeCode/registry key for each of our customers. That is why the condition must be set at build time.

I'm not sure I understand why the condition can not use properties. The prerequisite name can use properties, which makes sense, because when you have a branded product, the name changes for each customer.
If I had a prereq that was looking for a file, I could use properties, so this seems like an artificial restriction on other condition types.

I'd like to repeat my request that your product team consider adding the ability to use properties in prerequisite conditions.

thanks,
Dennis
Bogdan
Posts: 2796
Joined: Tue Jul 07, 2009 7:34 am
Contact: Website

Re: Prerequisites - using properties in "Registry Key Exists"

Hi,
We keep one AIP file as the master template for each of our brandings (we have 5 customers, each with their own branding). At build time, we use the master to customize each installer for our customers.
I'm afraid this is not a good solution in this case. You will need to create a separate aip file for each customer an then customize them using the command line tool.
I'm not sure I understand why the condition can not use properties. The prerequisite name can use properties
Please note that the prerequisite name is pseudo-formatted, this means that the value of that property will be resolved at build-time, not runtime.

Also you should now that Windows Installer public properties cannot be accessed or modified by an EXE file. You can modify or read the value of a property using a C++ DLL or VBScript.
Since our bootstrapper is an EXE file you can understand that properties cannot be used by it.

Regards,
Bogdan
Bogdan Mitrache - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
drivard
Posts: 50
Joined: Wed Dec 05, 2007 10:14 pm

Re: Prerequisites - using properties in "Registry Key Exists"

I'm afraid this is not a good solution in this case. You will need to create a separate aip file for each customer an then customize them using the command line tool.
I've been doing this for over 2 years with AI, very successfully. Note that I had mentioned we use the /DuplicateProject command-line option for each of our customers before modification. This is the point of the template feature. I've discussed this in detail with other members of support.
Keeping separate aip files for each customer is dangerous, because if you make a change in one, you need to make the same change in all of them. OK for 2 or 3 customers, but if you have 50 or 100, something will be missed. Thus templates... Change the product name, version, phone number, and any other properties that are used by CAs and other parts of the installer.
I have done this in the past with InstallShield, and for companies that OEM/brand their software, such as ours, it is a best practice.
Please note that the prerequisite name is pseudo-formatted, this means that the value of that property will be resolved at build-time, not runtime.
Yes. Exactly what I want.
Also you should now that Windows Installer public properties cannot be accessed or modified by an EXE file. You can modify or read the value of a property using a C++ DLL or VBScript.
Since our bootstrapper is an EXE file you can understand that properties cannot be used by it.
Yes, I am very familiar with the restrictions, which is why we use build-time branding, not runtime branding.

I'd like to repeat my request that your product team consider adding the ability to use properties in prerequisite conditions (which are resolved at build time).
Bogdan
Posts: 2796
Joined: Tue Jul 07, 2009 7:34 am
Contact: Website

Re: Prerequisites - using properties in "Registry Key Exists"

Hi,
I'd like to repeat my request that your product team consider adding the ability to use properties in prerequisite conditions (which are resolved at build time).
I have added this improvement on our TODO list and will try to implement it as soon as possible. Version 8.0 of Advanced Installer is very close to being released so most surely it will
not include this improvement, but the next one should.

Regards,
Bogdan
Bogdan Mitrache - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
drivard
Posts: 50
Joined: Wed Dec 05, 2007 10:14 pm

Re: Prerequisites - using properties in "Registry Key Exists"

Thank you Bogdan, I appreciate it!

Return to “Common Problems”