[haskell-platform] #62: It should be possible to run the Windows installer as non-admin

haskell-platform haskell-platform at projects.haskell.org
Fri Oct 26 03:42:33 BST 2012


#62: It should be possible to run the Windows installer as non-admin
-------------------------------+--------------------------------------------
 Reporter:  refold             |        Owner:  refold    
     Type:  enhancement        |       Status:  assigned  
 Priority:  minor              |    Milestone:  2013.2.0.0
Component:  Windows installer  |   Resolution:            
 Keywords:                     |  
-------------------------------+--------------------------------------------
Changes (by refold):

  * milestone:  2012.4.0.0 => 2013.2.0.0


Comment:

 This turned out to be harder than I expected. The
 [http://stackoverflow.com/questions/8732019/how-do-you-request-
 administrator-permissions-using-nsis/8735349#8735349 recommended way] is
 to just set `RequestExecutionLevel` to `admin`, but we can't do that since
 we also want to allow non-admin users to run the installer in portable
 mode. The [http://nsis.sourceforge.net/UAC_plug-in UAC plugin] is supposed
 to help with that, but I can't get the examples to compile ("Invalid
 command: UAC::_").

 I tried doing the following:

 {{{
 !macro CheckAdmin thing
 UserInfo::GetAccountType
 pop $0
 ${If} $0 != "admin" ;Require admin rights on NT4+
     MessageBox MB_YESNO "It is recommended to run this \
     ${thing} as administrator. Do you want to try to elevate privileges?"
 \
     IDNO CheckAdminDone
     SetErrorLevel 740 ;ERROR_ELEVATION_REQUIRED
     Quit
 CheckAdminDone:
 ${EndIf}
 !macroend
 }}}

 but the return code seems to have no effect. `MultiUser.nsh` seems to be
 old XP-era code that doesn't know about UAC prompts.

 If anyone has ideas on how to proceed, I'm eager to listen. For now, I've
 just added a warning if the installer is run as non-admin.

-- 
Ticket URL: <http://trac.haskell.org/haskell-platform/ticket/62#comment:16>
haskell-platform <http://trac.haskell.org/haskell-platform>
The Haskell Platform: a comprehensive and robust collection of Haskell libraries


More information about the Haskell-platform mailing list