[英]How to change install destination folder permisions in InnoSetup?
Say we install into Programm Files into folder PF/MyCoolApp/. 假设我们将Programm Files安装到文件夹PF / MyCoolApp /中。 We require Admin privileges for installation.
我们需要Admin权限才能安装。 How to make it possible for our application when started from user be capable to write into installation folder (download files, rewrite files, start downloaded applications)?
如何使我们的应用程序从用户启动时能够写入安装文件夹(下载文件,重写文件,启动下载的应用程序)?
Do you use 你用吗
[Setup]
PrivilegesRequired=admin
? ? If yes then user must enter admin credentials (UAC dialog is shown) and then he has automatically rigths to write to installation folder.
如果是,则用户必须输入管理员凭据(显示UAC对话框),然后他自动编写安装文件夹。
If he does not have these rights he cannot write to these (protected) folders but he may use Local app folder, Temp folder and many others designed for this purpose. 如果他没有这些权限,他就无法写入这些(受保护的)文件夹,但他可能会使用本地应用程序文件夹,Temp文件夹以及为此目的而设计的许多其他文件夹。
While this is not impossible, it is extremely anti-recommended practice (eg. if you do it, you fail Windows Logo certification). 虽然这不是不可能的,但这是非常反推荐的做法(例如,如果你这样做,你就失败了Windows Logo认证)。
If you want to provide upgrade functionality, the correct way to do it is to have your application download an installer (such as the Inno installer used to install the application in the first place, or a smaller "patch-style" updater) into a folder that you do have rights to (such as the user's temporary folder), and then execute that, letting it elevate to admin permissions and install as normal. 如果要提供升级功能,正确的方法是让应用程序下载安装程序(例如用于首先安装应用程序的Inno安装程序或较小的“补丁风格”更新程序)您确实拥有权限的文件夹(例如用户的临时文件夹),然后执行该文件夹,让它升级为管理员权限并正常安装。
Or simply detect when an upgrade is ready and link the user to the download page for your application so that they can download the update themselves. 或者只是检测升级何时就绪并将用户链接到应用程序的下载页面,以便他们可以自行下载更新。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.