1
votes

I'm trying to bundle a demo project with the WiX MSI installer for an application. My goal is to create a "Projects" folder that contains the "Demo Project" folder in the user's Documents directory.

Since my installation scope is "perMachine" adding files to a user directory results in the following error for each file:

It must use a registry key under HKCU as its KeyPath, not a file

I could fix this error by adding the RegistryValue element to each Component but, the demo project has at least 1000 files.

I was thinking about creating another installer for the demo project that would have a "perUser" install scope and then bundle that into a WiX bootstrapper. The only downside is that it feels like a hack.

What is a recommended method when installing complementary material for a application? Should I build another installer or is there a WiX extension that would allow me to copy files to the user's documents directory?

1

1 Answers

2
votes

Because it's a demo project and not critical to your app, one approach is to zip it up and have that single zip file as the component. The potential issue with demo projects in your component-per-file case is that users will start fiddling around with the demo in some way and eventually Windows Installer will be prompted to repair it. This is especially true if the project is something that clients open with a dev tool and start changing. You don't want the demo interaction with a repair to impact your running app.

There isn't a WiX or MSI way to copy files to user's folders because that's actually what the Registry keypath is for. It also has the advantage of working for user accounts that haven't been created yet. When another user logs on and uses the app Windows notices that the keypath is missing for that user and that prompts installation of the key path component (the file) from the original install source.