Error: Saving updated resources failed: 5

This forum can be browsed by the general public. Posting is limited to current SAPIEN license holders with active maintenance and does not offer a response time guarantee.
Forum rules
DO NOT POST LICENSE NUMBERS, ACTIVATION KEYS OR ANY OTHER LICENSING INFORMATION IN THIS FORUM.
Only the original author and our tech personnel can reply to a topic that is created in this forum. If you find a topic that relates to an issue you are having, please create a new topic and reference the other in your post.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
This topic is 2 years and 3 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
mem5000
Posts: 8
Last visit: Wed Feb 23, 2022 12:07 pm

Error: Saving updated resources failed: 5

Post by mem5000 »

To help you better we need some information from you.

*** Please fill in the fields below. If you leave fields empty or specify 'latest' rather than the actual version your answer will be delayed as we will be forced to ask you for this information. ***

Product, version and build: 5.8.196
Operating system: windows 10 20h2
PowerShell version(s): 7

*** Please add details and screenshots as needed below. ***

DO NOT POST LICENSES, KEYS OR ANY OTHER LICENSING INFORMATION IN THIS FORUM

for a couple months now i can't create exes...

I get -
>> Package 'C:\Code\Powershell Studio\Projects\EnfRemoteCaller\EnfRemoteCaller.psproj'
SAPIEN Package and Deploy Tool 4.5 (c) 2005 - 2021 SAPIEN Technologies, Inc.

------ Build started: EnfRemoteCaller, Configuration: x64 ------
Packaging with SAPIEN PowerShell V5 Host (Windows Forms) x64
Adding C:\Code\Powershell Studio\Projects\EnfRemoteCaller\EnfRemoteCaller.Package.ps1
Writing scripts to bin\x64\EnfRemoteCaller.exe
Error: Saving updated resources failed: 5

>> Completed

regardless of project. It's NOT my anti virus... i had it shut off to test, it still does it.
I'm running this as an Admin, so it's not a rights issue....

This error tells me NOTHING. What does it even mean?
User avatar
Alexander Riedel
Posts: 8478
Last visit: Tue Mar 26, 2024 8:52 am
Answers: 19
Been upvoted: 37 times

Re: Error: Saving updated resources failed: 5

Post by Alexander Riedel »

Error Code 5 means "Access Denied"
There are a number of reasons a file can be locked.
There is a free tool out there called "Lockhunter" which may be of assistance.
In general, the following situations cause an Access Denied error:
- Windows Security scanning a newly created file
- The applications being updated is currently actually running
- Folder access permissions. Being a local admin can still mean you have no write access to the folder
- Group policies preventing you from creating executable files.

First question would be, does "bin\x64\EnfRemoteCaller.exe" pre-exist and if so, can you manually delete it from Windows File Explorer?
Alexander Riedel
SAPIEN Technologies, Inc.
mem5000
Posts: 8
Last visit: Wed Feb 23, 2022 12:07 pm

Re: Error: Saving updated resources failed: 5

Post by mem5000 »

Hello!
so I did delete the file, and it gave the same error.

I went and looked and the file isn't even there.

So it fails to even just create a file...


I thought it might have something to do with the signing cert, as it acts weird - it pops a window up saying "this action cannot be completed because the other program is busy. Choose 'switch to' to activate the busy program and correct the problem." When i hit switch to, it just opens my start menu....

but you're saying it's purely a file rights issue... I'm not sure why. I'm running PS Studio as Administrator...
User avatar
Alexander Riedel
Posts: 8478
Last visit: Tue Mar 26, 2024 8:52 am
Answers: 19
Been upvoted: 37 times

Re: Error: Saving updated resources failed: 5

Post by Alexander Riedel »

The packager will delete the file if it didn't build correctly. So that it is not there is just a symptom but not a cause.
Remove the signature settings.
Reboot the machine to remove dangling locks (if you have not already).
I also highly recommend to NEVER run PowerShell Studio elevated. Normally that is not necessary. (if so please let us know why)
You can run scripts elevated if needed.
Alexander Riedel
SAPIEN Technologies, Inc.
mem5000
Posts: 8
Last visit: Wed Feb 23, 2022 12:07 pm

Re: Error: Saving updated resources failed: 5

Post by mem5000 »

ok im running it non elevated now
to get around the file lock issue entirely... i pointed it to a completely new folder C:\temp

still getting the same
Packaging with SAPIEN PowerShell V5 Host (Windows Forms) x64
Warning: Using alternate credentials usually prevents applications from running in personal folders (e.g. My Documents)
Adding C:\Code\Powershell Studio\Projects\EnfRemoteCaller\EnfRemoteCaller.Package.ps1
Writing scripts to C:\Temp\x64\EnfRemoteCaller.exe
Error: Saving updated resources failed: 5
1 error(s), 1 warning(s)

Is there nothing besides a locked file that can cause this error?
User avatar
Alexander Riedel
Posts: 8478
Last visit: Tue Mar 26, 2024 8:52 am
Answers: 19
Been upvoted: 37 times

Re: Error: Saving updated resources failed: 5

Post by Alexander Riedel »

Oh there is a wide range of things. Corrupt file systems, inherited folder rights, Moons of Saturn positions...

But USUALLY it is a very slow file scan by some security software.
We create an exe here, which usually triggers a scan from Windows Security and whatever software you have on top of that.
We have plenty of waits and retries in there to avoid updating a locked file but if it just takes too long, you get that kind of error.
This can happen if your hard drive is super busy doing other things. Magnetic drives can be more prone to that than SSDs.
You say you turned all that off, so I'll take your word for that.

You say this started a couple of months ago, which implies it worked on that machine before.
Probably it is now little late to investigate what changed then, but if you could...
I would recommend to take an entirely different machine and try there.
If that is the same result, it is likely something in your corporate network.
If not, it is something on your machine.
If you have a private machine outside of your network, that is a good test too.

Looking at the code, it is also possible that an invalid or corrupted icon file causes this issue.
If you have an icon file specified, remove it and/or try another one.
Alexander Riedel
SAPIEN Technologies, Inc.
This topic is 2 years and 3 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.