简体   繁体   中英

How to copy files and folders in ISWIX?

I am developing an installer using Wix. I am using the ISWIX add in. I want to copy some folders in installation directory during installation. And these files and folders must be deleted after successfully uninstalled. And I also need to copy a library to the system folder of the PC and that should also be deleted during uninstallation. For this, do I need to have admin access? Is my installer can have launch condition like to check if the user is Admin or not?

Though it contains multiple questions but all the questions are correlated.

If you want to install files into the "C:\\Program Files" or "C:\\Windows\\system32" directory you'll need to run the installer with administrator/elevated privileges. MSI has a built-in property that gets populated when the user as elevated privileges: "Privileged". You can add a LaunchConditions table entry with the condition "Privileged" - https://msdn.microsoft.com/en-us/library/aa370852%28v=vs.85%29.aspx

I'd also give this post a read - How do I get WiX installer to request administrative privileges?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM