简体   繁体   English

如何更改InnoSetup中的安装目标文件夹权限?

[英]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.

相关问题 如何在InstallAnywhere安装过程中删除InnoSetup安装? - How to remove InnoSetup Installation on InstallAnywhere Install Process? 如何摆脱烦人的InnoSetup文件夹选择机制? - How to get rid of annoying InnoSetup folder selection mechanism? System.Configuration.Install.Installer实例如何获取目标文件夹? - How a System.Configuration.Install.Installer instance can get the destination folder? InnoSetup:包含并自动安装DirectX - InnoSetup: include and auto-install DirectX 如何在没有尝试安装依赖项的情况下静默地从第三方执行innosetup安装程序? - How to execute innosetup installer from third party silently and without it attempting to install dependencies? 如何使InnoSetup删除除当前用户以外的所有人的文件夹权限? - How do I make InnoSetup remove permissions on a folder for everyone but the current user? 更改NSIS中的默认安装文件夹 - Change the default install folder in NSIS 永久自定义文件夹图标与InnoSetup在任何计算机中 - Permanent customized folder icons with InnoSetup in any computer InnoSetup,在运行时更改Uninstallable属性的行为? - InnoSetup, change the Uninstallable property behavior at runtime? Inno Setup默认安装文件夹更改 - Inno Setup default install folder change
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM