eagle3386
11th January 2009 23:02 UTC
Do it the “7-Zip way†(request admin _not_ on launch, but later)?!
Hey guys,
since I switched to a specific 7-Zip version I don’t really remember, I noticed 7-Zip’s installer requesting administrative rights when it gets to the step where it copies/registers it’s context-menu DLL.
I also know that there’s the UAC-plugin available, but after having a look at 7-Zip’s NSIS-file (included within its source code-archive, but attached to this post for your pleasure ;)), I couldn’t find such a call anywhere?!
So, how does 7-Zip do it then?
Any help would be greatly appreciated! :)
/Martin..
Anders
11th January 2009 23:04 UTC
Maybe nsis is not involved in the registration
eagle3386
11th January 2009 23:34 UTC
Well, since there are paragraphs like
# set "all users" mode
SetShellVarContext all
!insertmacro InstallLib DLL NOTSHARED REBOOT_NOTPROTECTED 7-zip.dll $INSTDIR\7-zip.dll $INSTDIR
and/or
WriteRegStr HKCR "Drive\shellex\DragDropHandlers\7-Zip" "" "${CLSID_CONTEXT_MENU}"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Shell Extensions\Approved" "${CLSID_CONTEXT_MENU}" "7-Zip Shell Extension"
I do believe NSIS is used.. ;)
Or is it because of these lines
!ifdef WIN64
ExecWait 'regsvr32 /s "$INSTDIR\7-zip.dll"'
!endif
within the script?
I’m asking all these questions, because I want to request administrative rights _only_ in case the user has not enough “power†to write to an UAC-protected folder — in all other cases, the installer shall run fine with the user-level.. ;)
Anders
12th January 2009 00:06 UTC
what do the details in the UAC dialog say? (command line etc)
eagle3386
12th January 2009 00:47 UTC
I’m sorry, but I don’t know what you mean with “UAC dialogâ€.. :(
Could you explain that in more detail, please?
Anders
12th January 2009 01:46 UTC
requesting administrative rights, elevation dialog or whatever you wanna call it http://img.tomshardware.com/uk/2007/...ac_meldung.png
eagle3386
12th January 2009 18:38 UTC
Right, now I got it.. ;)
The details only show path + filename and look like this:
C:\Users\<User>\Desktop\7z464-x64.msi
And that’s where I should apologize for being so dumb (again).. :rolleyes:
It’s actually an MSI-setup, not a NSIS-one..