WIX: copy file to custom dir in another partition

后端 未结 3 965
有刺的猬
有刺的猬 2020-12-19 17:51

I need to install my app\'s files to usual location like C:\\Program Files\\MyApp
and also need to copy several of them into custom folder in another partit

3条回答
  •  庸人自扰
    2020-12-19 18:11

    It's against Windows Installer Best Practices to hard code directories. You can never assume there will always be a D: or even a C:. Still, customers have asked (demanded) that I install something to D:\FOO.

    So, how to make the customer happy and have the install still "work" on that VM that doesn't have a D:? By redirecting the directory at install time with a custom action that only redirects it if D: is a fixed hard disk.

    Also, while the CopyFile element is useful, it's not really needed because you can just author the files into components twice and smart cabing will make sure your MSI doesn't bloat up by having the File records point to the same entry in media \ cab storage.

提交回复
热议问题