0

I have created a program that needs to have DLLs in the C:\ folder. I have also created an installer using "Microsoft Visual Studio 2017 Installer Projects", but I would like it to create the folder C:\Subfolder with its files when it installs.

How can I do this? Thank you!

João Silva
  • 122
  • 10
  • A very delayed "answer" below. – Stein Åsmul Oct 03 '18 at 14:55
  • 1
    Don't do this. It's very poor practice. Standard privileged users haven't had write access to the root C:\ folder or even Program Files folders since Windows 2000. **THERE ARE BETTER PLACES TO PUT YOUR DLLS!** – Joel Coehoorn Oct 04 '18 at 22:18
  • Yes, have to agree. In fact a software that installs files directly to a folder on the **C:** drive will very likely never be approved for distribution on the company network. These issues have become much more restrictive over the years. Standards that don't harm anything should be followed. Can we ask what the concrete details are? – Stein Åsmul Oct 06 '18 at 03:25
  • 1
    [Long rant on the issue of root-folder installations](https://stackoverflow.com/questions/56304840/how-to-compress-multiple-files-and-directories-with-wix-installer-and-copy-and-i/56305728#56305728) :-). – Stein Åsmul May 27 '19 at 15:23

1 Answers1

1

If you use MSI / Windows Installer to install your package, then installing directly to C:\ is intentionally made difficult. There are almost no valid reasons to install directly to C:\. If at all possible install your application to Program Files (64 bit files) or Program Files (x86) (32-bit files) on your system drive. There are ways to force an MSI to install directly to C:\, but no good ways. A long rant about it here (and how to do it with WiX).

"Microsoft Visual Studio 2017 Installer Projects" are rather limited, there are many alternative tools you can use. Some are free, some are commercial, and some of the commercial ones feature some free functionality:


Some Additional Links:

Stein Åsmul
  • 39,960
  • 25
  • 91
  • 164