简体   繁体   English

无法从 MSI 包中读取 zip 文件

[英]Unable to read a zip file from MSI package

I am using Advanced installer version 18.6.1.我正在使用高级安装程序版本 18.6.1。 I've created a MSI package with .NET Core API app.我已经使用 .NET Core API 应用程序创建了一个 MSI 包。 I want to read a zip file in my application from APPDIR directory added from "Files and Folders".我想从“文件和文件夹”添加的 APPDIR 目录中读取我的应用程序中的 zip 文件。 The exception from my logs;我的日志中的异常;

An unhandled exception of type 'System.UnauthorizedAccessException' occurred in System.IO.Compression.FileSystem.dll Additional information: Access to the path 'C:\\My_App_Dir_Includes_Zip\\My_Zip_File.zip' is denied. System.IO.Compression.FileSystem.dll 中发生类型为“System.UnauthorizedAccessException”的未处理异常 附加信息:对路径“C:\\My_App_Dir_Includes_Zip\\My_Zip_File.zip”的访问被拒绝。

Note: I added IIS_USER and SYSTEM user roles while packaging the MSI file which are assigned to my "My_App_Dir_Includes_Zip" folder.注意:我在打包分配给我的“My_App_Dir_Includes_Zip”文件夹的 MSI 文件时添加了 IIS_USER 和 SYSTEM 用户角色。

This may happens if you need to impersonate installing user.如果您需要模拟安装用户,则可能会发生这种情况。 From the file download operation dialog you need to enable the "Impersonate installing user" option:在文件下载操作对话框中,您需要启用“模拟安装用户”选项: 在此处输入图片说明

This way, the file download operation is done as the user installing the application, not under the Local System account.这样,文件下载操作是在用户安装应用程序时完成的,而不是在本地系统帐户下完成的。

If using Program Files as install location, you may need admin privileges when extracting the archive.如果使用 Program Files 作为安装位置,则在解压缩存档时可能需要管理员权限。 Or, you can assign Everyone write permissions in that location through the Permissions tab.或者,您可以通过“ 权限”选项卡在该位置分配“所有人”写入权限。

Note that Advanced Installer offers also predefined funcionality to Extract Archive .请注意,高级安装程序还为Extract Archive提供了预定义的功能。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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