Collins
Posts: 138
Joined: Wed Oct 12, 2016 2:57 pm

Importing Registry File With Properties Changes Formating

We are converting over our old Wise Install Studio installs and when I import the registry files into AI, it formats the property instead of leaving it as is. Here is an example:

In the Registry file:
[HKEY_CLASSES_ROOT\CLSID\{03C4C5F4-1893-444C-B8D8-002F0034DA92}\InprocServer32]
@="[INSTALLDIR]Redemption.dll"
"ThreadingModel"="Apartment"

This is how AI imports it:
[\[]INSTALLDIR[\]]Redemption.dll

It should be like this:
[INSTALLDIR]Redemption.dll

It also does it for other values, like this one:
[\{]00020424-0000-0000-C000-000000000046[\}]

Instead of:
{00020424-0000-0000-C000-000000000046}
Daniel
Posts: 8238
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Importing Registry File With Properties Changes Formating

Hello,

Unfortunately this is our default behavior when importing registry values. We escape using formatted escape characters sequence ([\]) all formatted special chars (e.g. [, {, etc) so that at install time they will be written in the registry exactly as they are.

Unfortunately if you want the [INSTALLDIR] property reference be used as a formatted reference you will have to manually un-escape it by removing the [\] chars sequence.

Maybe we will consider in the future an option not to escape the possible formatted property references, thus it will not lead to a foolproof solution. You may have the case when a setup project contains a registry value with a formatted reference (e.g. [INSTALLDIR]) and also a reg value with a hardcoded value similar with a formatted reference (e.g. [foo_value]).

Thank you for your understanding.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Scotty
Posts: 1
Joined: Sun Jul 24, 2022 8:24 am

Re: Importing Registry File With Properties Changes Formating

Hi
I'm actually having the exact same issue with Collins.
One of my projects is upgraded from Advanced Installer 7.5, to the latest 19.5; we have a command line to call "AdvancedInstaller.com /edit /ImportRegFile my_reg.reg" to import registries info HKCU from file "my_reg.reg".

While previously on 7.5, the path of an ocx in the reg file is like:

Code: Select all

[HKEY_CURRENT_USER\Software\Classes\CLSID\{XXXXXXXXXX}\InprocServer32]
@="#myocxfile.ocx#"
"ThreadingModel"="Apartment"
it worked pretty good, but that's not the case for now.
With above same reg file, after "/ImportRegFile", or installation, the "#myocxfile.ocx#" is not replaced with its installation full path as before which is what we expected, but instead it is as is, of course that's not a valid path to locate the file, which brings runtime errors afterwards.

Since that reg file will be changed from time to time, we want an automatic deployment process, we do not want to open the aip project to manually remove those escaped characters such as "[\[]", so my question is, what should I do?

Regards
Scotty
Catalin
Posts: 6586
Joined: Wed Jun 13, 2018 7:49 am

Re: Importing Registry File With Properties Changes Formating

Hello Scotty and welcome to our forums,

I have tried running some tests to see if I could find a solution to this, but unfortunately I receive the following error when trying to import the registry you provided:
This does not appear to be a valid registration file. Only Windows 2000 or greater REG files are supported.
This happens when trying to import from both UI and the command line.

If possible, please forward me the registry file you are importing (you can add it as an attachment here) so I can further investigate this on our end.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”