Old 11th December 2019, 23:46   #1
Alan
Junior Member
 
Join Date: Dec 2019
Posts: 3
Acces denied for Windows 10 shortcut

I am getting an "Access Denied" message when trying to use the desktop shortcut created in Windows 10 with NSIS. The same with the alphabetical menu.
I had not such problem with Vista and Windows 7, so it is probably related to Windows 10.
I have found that the Security for this shortcut and the program directory created with NSIS is set to special and has no read or execute rights.
I can change this manually, but I am afraid the same will happen to other people to which I distribute my program.
Has anybody encountered this?
Any help will be appreciated.

Thank you
Alan is offline   Reply With Quote
Old 12th December 2019, 00:20   #2
Alan
Junior Member
 
Join Date: Dec 2019
Posts: 3
Some more info
I am using NSIS 3.04
In my script I have
RequestExecutionLevel admin
SetShellVarContext all

Even if I turn Win10 UAC off, I still get the same

System, Administrator get their access rights OK
My acount which is the owner/creator (even if I am administrator) get special rights ( which has no rights defined)
Alan is offline   Reply With Quote
Old 12th December 2019, 02:24   #3
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,262
Are you installing to Program Files or some other directory? Program Files should have a correct ACL by default.

Start cmd.exe and run
Quote:
cacls "c:\Program Files"
(or whatever the directory is)

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 12th December 2019, 03:57   #4
Alan
Junior Member
 
Join Date: Dec 2019
Posts: 3
I think I found my problem
On startup, my program was trying to write a config file to Program files x 86\MyProgram and I think this is not allowed by windows.
I will have to modify it to write to AppData or ask users to install it to another directory.
Thank you anyhow.

Quote:
C:\Program Files
NT SERVICE\TrustedInstaller:F
NT SERVICE\TrustedInstaller:(CI)(IO)F
NT AUTHORITY\SYSTEM:C
NT AUTHORITY\SYSTEM:(OI)(CI)(IO)F
BUILTIN\Administrateurs:C
BUILTIN\Administrateurs:(OI)(CI)(IO)F
BUILTIN\Utilisateurs:R
BUILTIN\Utilisateurs:(OI)(CI)(IO)(accès spécial*:)
GENERIC_READ
GENERIC_EXECUTE

CREATOR OWNER:(OI)(CI)(IO)F
APPLICATION PACKAGE AUTHORITY\ALL APPLICATION PACKAGES:R
APPLICATION PACKAGE AUTHORITY\ALL APPLICATION PACKAGES:(OI)(CI)(IO)(accès spécial*:)
GENERIC_READ
GENERIC_EXECUTE

APPLICATION PACKAGE AUTHORITY\TOUS LES PROGICIELS D'APPLICATIONS AVEC RESTRICTIONS:R
APPLICATION PACKAGE AUTHORITY\TOUS LES PROGICIELS D'APPLICATIONS AVEC RESTRICTIONS:(OI)(CI)(IO)(accès spécial*:)
GENERIC_READ
GENERIC_EXECUTE
Alan is offline   Reply With Quote
Old 12th December 2019, 14:23   #5
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,262
Correct, your program is not allowed to write to its install directory when it is installed for all users.

If your app is not marked as UAC compatible then Windows might allow the write by redirecting the file for that user, this is called UAC Virtualization: https://www.microsoftpressstore.com/...8450&seqNum=9#. I don't know if Windows 10 supports this but Vista, 7 and 8 does.

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Tags
uac

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump