Old 11th September 2018, 19:49   #1
nickdollahz
Junior Member
 
Join Date: Apr 2018
Posts: 11
UAC Plugin + Disable Admin Approval Mode

When the Group Policy User Account Control: Run all administrators in Admin Approval Mode is disabled the UAC Plugin doesn't function correctly. Any way around it? I'm assuming not as it is disabling UAC but I was hoping I could still pass the variable somehow.

Here is what the UAC_tests Example says:

PASS:TEST:StartEnv <<< inner1 != outer1
FAIL:UAC_AsUser_GetGlobalVar 1.1 <<< inner1 == outer1
FAIL:UAC_AsUser_GetGlobalVar 1.2 <<< inner1 == outer1
FAIL:UAC_AsUser_GetGlobalVar 2.1 <<< inner2 == outer2
FAIL:UAC_AsUser_GetSection $0 <<< inner0 == sec0_outerName
FAIL:UAC_AsUser_GetSection $1 <<< inner0 == sec0_outerName
Completed, passed 1 of 6 tests

The way I use the UAC Plugin is probably not the intended way to use it. Although in my situation I don't have a choice. Alternatives I considered is writing two installers. One for the inner and one for the outer. The Outer does a Shell Exec and calls the inner. Then I would need to pass the variables somehow.

Any ideas?
nickdollahz is offline   Reply With Quote
Old 11th September 2018, 23:53   #2
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 4,926
I don't remember exactly what that setting does but if UAC is disabled then there are no integrity levels so we don't have to worry about that.

Then we are left with:

A) User (parent process) is admin. In this case there is no need to pass variables or anything, the user is as admin as you can be. It would technically be possible to create a restricted token and run the other process with that token but I don't really see the point. The old SAFER plug-in would be able to do that but it should only be used when UAC is off.

B) User (parent process) is not admin. I believe the plug-in already handles this? I think it puts up it's own RunAs dialog in this case.

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 12th September 2018, 18:18   #3
nickdollahz
Junior Member
 
Join Date: Apr 2018
Posts: 11
Question

I believe the issue stems from the way I am using the UAC Plugin.
I understand the way I use it is not the intended purpose but it works in most cases just not the one specified above.

So basically I go through and do the user changes in the outer installer and the admin changes no the inner installer.

I have attached an example. Once I disable that group policy the installer no longer selects the right sections. A theory I had is that it is due to the inner instance never being created in the first place and the placement of the Select Section macros.

Maybe I need to rearrange some things or there is a better way to do this? I like the UAC plugin because it keeps everything in one installer. It is a pain to pass data between installers and can get messy/hard to maintain. But maybe that is the better method.
Attached Files
File Type: nsi UserAdminInstaller.nsi (4.0 KB, 59 views)
nickdollahz is offline   Reply With Quote
Old 12th September 2018, 21:56   #4
nickdollahz
Junior Member
 
Join Date: Apr 2018
Posts: 11
Cool I think I got it

I think I was able to figure it out by moving around some of the logic. Apparently making a simplified version of things made it easier to identify the issue.

Still not sure I completely understand how the UAC parts work but it is giving me the intended behavior. Wish I was smart enough to figure out why the SkinnedButtons plugin is stopping the Page Macros but for now this works.
Attached Files
File Type: nsi UserAdminInstaller.nsi (4.4 KB, 68 views)
nickdollahz is offline   Reply With Quote
Reply
Go Back   Winamp & SHOUTcast Forums > Developer Center > NSIS Discussion

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