cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Tim_Mayert
Level 9

During install run regedit to register a .reg file

During the install the admin has an option to supply a property on the command line that contains the full path and file name of a .reg file that needs to be registered during the install process.

The custom action that is then called if this property exists is:
"[WindowsFolder]regedit.exe" /s "[REGFILE_PROPERTY]"

This seems to work in most cases, but it seems to not work if the path that is supplied is a UNC path.

The log does not indicate and issue, but if you copy the exact command line out of the log, which shows the correct UNC path\file name, and trigger it from a command prompt the file is correctly registered.

Why does this not work when triggered from an install custom action? Is there anything that I can do to get this working?

Thanks,
Labels (1)
0 Kudos
(5) Replies
RobertDickau
Flexera Alumni

It could depend whether the action that launches regedit (ignoring usual cautions of custom action changes not being removed at uninstall or rollback) is scheduled for deferred execution in system context. As mentioned in this InstallTalk blog post, for example, the Windows Installer service might not have rights to access the local network, which could cause an action referring to a UNC path to fail.
0 Kudos
Tim_Mayert
Level 9

I had the custom action set as Deferred in System Context and so I changed it to Deferred Execution and it seemed to fix the issue with UNC paths.

Now that is with an administrative command line run of the install. So does this mean that if the install is pushed out with GPO and it is pushed out to systems that has no one logged in that it would then fail in these cases?
0 Kudos
Christopher_Pai
Level 16

I would rather distribute a transform including registry components.
0 Kudos
Tim_Mayert
Level 9

How do you distribute this as a transform that includes a registry componet? The .reg file is a file that is only supplied by the Administrator and is only generated on their machine with specific hardware.

We have a hardware component that when plugged into the users machine will generate some registry keys. The Admin would then export these keys to a .reg file that is then pushed with our software across the network.

So if there is a way to have this captured into a transform then sure I would do it that way...
0 Kudos
Christopher_Pai
Level 16

Some vendors ( Symantec for instance ) have been known to distribute deployment kits that have a wizard UI for collecting information and then generating the transform on site.

I've done this with C# using the Microsoft.Deployment.WindowsInstaller namespace to update the tables and generate the transform.
0 Kudos