PDA

View Full Version : Import REG problem



musabio
12-27-2008, 11:35 AM
Under Vista Ultimate SP1 and SB Developer Edition 6.9.2415, I'm trying to import a REG file but without success. I start by exporting the REG file from REGEDIT on the same machine, and it looks like this:

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\MSAB\JBCT\ATE]

[HKEY_LOCAL_MACHINE\SOFTWARE\MSAB\JBCT\ATE\HostList]
@="HB"
"HB"="1"

[HKEY_LOCAL_MACHINE\SOFTWARE\MSAB\JBCT\ATE\Hosts]

[HKEY_LOCAL_MACHINE\SOFTWARE\MSAB\JBCT\ATE\Hosts\HB]
"Transport"="TELNET"
"TTY"="AM75G"
"Address"="1.2.3.4"


I click on the Registry item in the Visualizer, then right click on HKEY_LOCAL_MACHINE, select Import REG, and select my .REG file. The import dialog appears and the progress bar quickly goes from 0 to 100%, and the Finish button becomes enabled, but the "Lines Processed" remains at 0, and there is no sign of anything having been added to the script. (And running the script doesn't install the registry items.)

Am I missing some detail? Note that the REG file is not corrupt, as it can be imported successfully by REGEDIT. I've also tried exporting and importing other registry folders, but always get the same result. Also note that my installation runs elevated, so SB asks me to elevate when I launch it.

The doc says to first "select the feature with which you want to associate the imported keys and values", but the registry hives in my case are all listed under "always install". Yet if I highlight the "Registry 'Always Install'" item at the top of the registry hierarchy in the left pane, rather than the HKEY_LOCAL_MACHINE folder, and then try to import from the shortcut menu, the open dialog never appears. So it seems necessary to select or at least right click on one of the actual registry root folders first (although that seems a bit weird to me, given that the REG file contents are "absolute").

Related question about HKCU: I gather that you can't very well import into the HKEY_CURRENT_USER hive if running the installation elevated. Assuming that's true, what are the preferred workarounds? Most of the discussion about this issue on this forum seems to revolve around uninstallation, but the issues are slightly different there in that the app has already been installed, so you can more easily write a custom uninstall and launch it from the app itself, or the start menu. One obvious solution would be to run the install in non-elevated mode, but since the installation involves several sub-tasks that would then individually require elevation, that seems pretty dreadful. Another idea is to install into some non-user-specific hive, like HKLM, and then let the app transfer it to the HKCU when the app is launched, but one downside of that is the non-elevated app may not be able to remove the items from the HKLM. I take there is no way way to de-elevate from within the elevated install program, in order to import the REG items and/or ShellExecute. Any suggestions would be welcome.

linder
12-27-2008, 12:39 PM
Hello,

Could you please send the .reg to support@lindersoft.com and we'll review it.

Thanks,
Friedrich

linder
12-27-2008, 12:42 PM
With regard to HKCU. Modern Windows OS (Windows Vista/2008/Win7) do not allow to install to HKCU nor to uninstall from HKCU. Current user configurations have to be handled from within the application, not the installation!!!

Running an installation "unelevated" is not an option because you can't write to protected areas in this case.

Hope this helps.

Friedrich

musabio
01-05-2009, 01:05 PM
Just to follow-up, I did send you the .REG file (on Dec 27), which references HKLM (not HKCU) and doesn't work for me, so there may be a problem to look at there. But for my immediate needs, your comment about not trying to update HKCU from an installer was enough to convince me of the error in my ways, so I've followed your suggestion and moved the necessary registry logic to the application itself. If the email was lost in the holiday shuffle and you still want to look at that, let me know. Otherwise, feel free to assume it's a spurious error on my part and can be dropped, as the matter is strictly academic at this point. Happy new year and thanks for the excellent support.

linder
01-06-2009, 03:20 AM
Hello,

Happy New Year!

I checked our emails and the spam folder. Unfortunately, we did not received the .reg :( Would you please be so kind to re-send it?

Thanks,
Friedrich