Comments (16)
Interesting. The new files are being written with the admin privileges, and thats probably what blocks the non-admins. Can you update the app as a non-admin?
from nappupdate.
Hello,
I have a simular problem. The self-update works file for non-admin the first time.
When the update runs they must give the admin password and the update goes well.
But a second update won't work because the file has now a lock. I think only a admin can update it than.
How to fix this.
from nappupdate.
What do you mean by "a second time"? does restarting the app / PC help?
from nappupdate.
Thanks for the fast response
Sorry: a new update
no restarting doesn't help (app and pc)
So first update 1.0 to 1.1 works when given admin password
Update from 1.1 to 1.2 (week later) fails.
the file has a lock icon after update to 1.1
from nappupdate.
It looks like that the file to be updated(because it's in c:\program files) need admin rights to update. After the update the file can only be execute by a admin.
from nappupdate.
Thanks for the clarification. If you could provide a way to reproduce this that would be great.
from nappupdate.
I have code a quickfix, not usably for all users, the file is writen without rights for the group users
In the FileUpdateTask.cs function public override TaskExecutionStatus Execute(bool coldRun)
after: File.Move(_tempFile, _destinationFile); ~rulenumber 120
DirectoryInfo dInfo = new DirectoryInfo(_destinationFile);
DirectorySecurity dSecurity = dInfo.GetAccessControl();
dSecurity.AddAccessRule(new FileSystemAccessRule(new SecurityIdentifier(WellKnownSidType.BuiltinUsersSid, null), FileSystemRights.ReadAndExecute, InheritanceFlags.ObjectInherit | InheritanceFlags.ContainerInherit, PropagationFlags.NoPropagateInherit, AccessControlType.Allow));
dInfo.SetAccessControl(dSecurity);
This give's the user group rights on the file
I think the problem is, that the file is updated by the runas users and has his privaliges and not the user privaliges
from nappupdate.
Instead of this, I believe the new file being writte needs to get the same perms as the file being overriddenthings
from nappupdate.
That is much better! will that be in a release soon?
from nappupdate.
@jderoij can you send a pull request for this? sorry a bit swamped at the moment
from nappupdate.
The way around this is to check if the current user has write access to the files. If not, make the updater run elevated.
from nappupdate.
This one causes me a lot of problems. I'm happy to do a PR to add this to FileUpdateTask.cs:
// Copy _detinationFile access rights to _tempFile before Move.
FileInfo fiDest = new FileInfo(_destinationFile);
FileInfo fiSrc = new FileInfo(_tempFile);
FileSecurity ac = fiDest.GetAccessControl();
ac.SetAccessRuleProtection(true, true);
fiSrc.SetAccessControl(ac);
?
from nappupdate.
@ianwall What problem does that code solve?
from nappupdate.
The one this thread is about - i.e. after an update the file permissions are changed to include s specific user, rather than 'users', so the next update fails. This copies the original files permissions, rather than adding 'Users' to the files as per @jderoij's quickfix.
from nappupdate.
@ianwall Sounds like a proper solution. A PR would be appriciated.
from nappupdate.
This has been resolved thanks to @ianwall and will be included in the next release.
from nappupdate.
Related Issues (20)
- No time and/or energy to maintain this project HOT 3
- Support net core HOT 3
- Incorrect file version check for text files HOT 1
- Byteorder mark removal in UncSource removes first left angle bracket '<' of xml document HOT 2
- Reflection.SetNauAttributes doesn't parse date string correctly if OS is not set to English HOT 2
- ProgressCallBack
- Is this project dead? HOT 7
- Exception on task preparation HOT 6
- Updater web client caching HOT 1
- Could not launch cold update process
- Error running the Sample Demo HOT 1
- Help with conditions HOT 1
- upgrade framework 4 HOT 3
- Configuration not loading
- Allow feed to be in JSON format
- Sign Feed HOT 5
- Zip or 7z output
- Command Line Arguments HOT 2
- Issue replacing exe HOT 1
- UpdateManager.Instance.BaseUrl is not accessible HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nappupdate.