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..
Do it the “7-Zip way†(request admin _not_ on launch, but later)?!
7 posts
Maybe nsis is not involved in the registration
Well, since there are paragraphs like
Or is it because of these lines
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.. 😉
and/or# set "all users" mode
SetShellVarContext all
!insertmacro InstallLib DLL NOTSHARED REBOOT_NOTPROTECTED 7-zip.dll $INSTDIR\7-zip.dll $INSTDIR
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
within the script?!ifdef WIN64
ExecWait 'regsvr32 /s "$INSTDIR\7-zip.dll"'
!endif
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.. 😉
what do the details in the UAC dialog say? (command line etc)
I’m sorry, but I don’t know what you mean with “UAC dialogâ€.. 🙁
Could you explain that in more detail, please?
Could you explain that in more detail, please?
requesting administrative rights, elevation dialog or whatever you wanna call it http://img.tomshardware.com/uk/2007/...ac_meldung.png
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).. 🙄
It’s actually an MSI-setup, not a NSIS-one..
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).. 🙄
It’s actually an MSI-setup, not a NSIS-one..