jdawar2593
Posts: 7
Joined: Mon Feb 18, 2019 4:32 pm

Access to the zip file is denied when running Powershell ISE script

Hello Tech Support,

I am running an exe installer with a "Run Powershell Script File" custom action which is intended for upgrading a SQL database.

My installer places a folder with different files in it on my Desktop which includes a Zip file (named "HF1.zip") that my Powershell ISE script intends to unzip and extract in the process of installation.

However, the Zip file will not allow the Powershell script to extract from it, and I get an error in the log that says "ERROR: Access to the path 'HF1' is denied."

I tested just installing the folder to my Desktop, without the custom action, and manually running the Powershell script. That worked, but only when I ran the Powershell script as an Administrator. If I didn't run it as Administrator, I got the same error.

I'm suspecting this is a permissions/rights issue??

I re-added the custom action and tried using the "Run under the LocalSystem account with full privileges (no impersonation)" checkbox, but that gave me another error that I don't want - "Cannot open database "<database name>" requested by the login. The login failed.
Login failed for user 'NT AUTHORITY\SYSTEM'."

How can I run my Powershell script that needs to extract from a Zip file?
Catalin
Posts: 7845
Joined: Wed Jun 13, 2018 7:49 am

Re: Access to the zip file is denied when running Powershell ISE script

Hello,

This, indeed, looks like a permission issue. Can you please go to "Install Parameters" page and check the "Run as administrator" option from under the "Installation Options" section and see if that helps?

All the best,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
jdawar2593
Posts: 7
Joined: Mon Feb 18, 2019 4:32 pm

Re: Access to the zip file is denied when running Powershell ISE script

Hi Catalin,

Thank you so much! That solved my issue.

I unchecked the "Run under the LocalSystem account with full privileges (no impersonation)" box and checked the "Run as administrator" box and it successfully extracted from the zip folder.

I somehow didn't see that option.

I appreciate your help and prompt response!

Thanks, Jackie
Catalin
Posts: 7845
Joined: Wed Jun 13, 2018 7:49 am

Re: Access to the zip file is denied when running Powershell ISE script

You are always welcome, Jackie.

I am glad I could help.

All the best,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”