views:

17

answers:

0

I'm trying to create a setup project. On install, I want it to create some registry keys and delete others. On uninstall, I want it to do the opposite.

Regarding creation of keys on install and removing them on uninstall - no problem, it's built into the setup project.

Problem is with removing keys at install (and adding them back at uninstall).

The latter is not built into the setup project, so I had to use Custom Action.

And here another problem reveals: The machine I'm installing on is Windows 7 64bit. I changed the setup project TargetPlatform to 64bit, and the custom action dll to target 64bit as well.

The custom dll (which inherits System.Configuration.Install.Installer of course) is running 'regedit.exe' (with a .reg file as parameter) using Process.Start, but it doesn't matter how I 'play' with the target platforms, when I try to install it (double clicking the compiled setup project), it opens several msiexec.exe processes, some in 32bit (verified in ProcessExplorer), therefor my custom dll keep changing the SysWow64 sub nodes instead of the 64bit node (which is somewhere under HKEY_LOCAL_MACHINE).

Any way to perform this with the VS setup project and not moving to a different kind of installer?