mmadden
Posts: 22
Joined: Fri Jun 10, 2005 6:21 pm
Location: West Conshohocken, PA

Importing registry entries with Variables issue

I have another registry issue in this forum, but its not directly related, but my workaround is compounded by this issue:
Its a two-fold problem with the lack of a find-and replace and and importing issue.

:arrow: Scenario:
I have a simple registry entry. A reg_SZ type. When my end app is installed and running normally the entry looks like this:
Keyname: Objective0
Keydata: c:\windows\regedit.exe


Creating a simple AI project with nothing but this registry entry- it works fine.

:arrow: Adding complication:

Now-I want to use the AI option to use variables. Which should at install time replace them with values from the installing computer as appropriate. As some systems will will have Windows in c:\Windows or c;\winnt or maybe even on another drive. I want this install to be as flexible as possible.

So in AI in the registry section I replace c:\windows with [WindowsFolder] so it now looks like this:
"[WindowsFolder]\regedit.exe"

Compiling and installing the project works as expected and the resulting value in the actual registry is correct as c:\windows\regedit.exe.

:arrow: Now for the problems:
1.) When I import my settings from a reg file obviously the variables are not there-I have to manually edit each registry entry to replace the hard coded path with the AI variable. This is a very laborious process (I have about 50 registry entries. I can't find any way to do a find and replace.

2.) If I modify the reg file (or registry) ahead of time with the hard coded paths already replaced with the variables (using notepad's find and replace option): the reg file entry looks liek this:
"Objective0"="[WindowsFolder]\\regedit.exe"
When I import the reg file (or add a key from the registry directly)additional characters are being added to the entry and it now looks like this:
[\[]WindowsFolder[\]]\regedit.exe. Which when installed is not being process by AI as a variable.
Again I can't simply use a find & replace to fix the problem (which I could live with if that was all i had to do).


:?: Is there a way to do a find and replace on registry entries in the AI project?
:?: Is there a certain format I can put my registry entry or reg file entry so that AI imports it properly without adding any characters?

Thanks
Ionut
Posts: 605
Joined: Tue Nov 22, 2005 11:29 am
Contact: Website

Hi,
Is there a way to do a find and replace on registry entries in the AI project?
Not from the user interface. However, you have the option to manually edit the AIP file after importing the REG file.
Is there a certain format I can put my registry entry or reg file entry so that AI imports it properly without adding any characters?
I would suggest using something like "|WindowsFolder|\\regedit.exe" (for example) in the REG file. After importing it in AI and saving the project, perform a Search and Replace in the AIP file ("|WindowsFolder|" -> "[WindowsFolder]").

I have added the option to replace hard-coded paths with Properties on our TODO list. Thank you for your suggestion.

Regards,
Ionut
Denis Toma
Advanced Installer Team
http://www.advancedinstaller.com/
mmadden
Posts: 22
Joined: Fri Jun 10, 2005 6:21 pm
Location: West Conshohocken, PA

Thanks. That worked. I didn't even think of that.

Now if that were my only registry problem I would be good to go. The second issue I have (and I detailed in another topic), specifically relates to how characters are being stripped from my registry entries everytime the AIP/project is loaded. Which makes editing the AIP file a half working solution.

Quick summary of the other issue.
My registry data contains numbers (etc) separated by TABs.
I import them into AI and the tabs display as squares (as expected).
If I compile and run everything is fine. The registry entry is created properly with the TABs.
The problem is if I close AI and reopen my project, the tabs are stripped/replaced with only spaces. That TABs are an apparent delimiter that the application uses, and I can't find anyway to modify the app to accept spaces (or other character) instead.

I have at least 45 lines with several tabs in each so its not a quick manual fix.

So the best solution would be a Find/Replace from the GUI so that I can import a registry with TABs and Variables, and not have to close and reopen the AIP file, unless of course there is some way to edit the AIP while I have it open?? Or another solution would be for the 'TABs getting stripped issue to be resolved'.

Thanks
Ionut
Posts: 605
Joined: Tue Nov 22, 2005 11:29 am
Contact: Website

Hi,

This bug has been fixed and will not appear anymore in version 4.2, which is scheduled this week.

Regards,
Ionut
Denis Toma
Advanced Installer Team
http://www.advancedinstaller.com/
mmadden
Posts: 22
Joined: Fri Jun 10, 2005 6:21 pm
Location: West Conshohocken, PA

Yep Its fixed

The Tabs Stripping issue has indeed been fixed in v4.2.
Thanks much!
:D

Return to “Common Problems”