[Hackage] #320: cooperation with Windows Vista's User Access Control

Hackage trac at galois.com
Sun Sep 20 13:18:25 EDT 2009

#320: cooperation with Windows Vista's User Access Control
  Reporter:  Toxaris        |        Owner:         
      Type:  enhancement    |       Status:  new    
  Priority:  normal         |    Milestone:  _|_    
 Component:  Cabal library  |      Version:
  Severity:  normal         |   Resolution:         
  Keywords:                 |   Difficulty:  normal 
Ghcversion:  6.8.2          |     Platform:  Windows
Comment (by duncan):

 According to [http://msdn.microsoft.com/en-us/library/bb756990.aspx this
 MSDN article] we have to use `ShellExecute()` to be able to run a separate
 helper program that has a manifest that says it needs admin priviledges.
 It's either that or making an out-of-process COM component that runs with
 higher privilege.

 Using the ordinary `CreateProcess()` will fail. Apparently
 `ShellExecute()` catches the error and goes off and talks to some service
 to launch the program on our behalf. In turn that service pops up a UAC
 prompt. Apparently we cannot just talk directly to that service (at least
 there's no documentation on it), we have to go via `ShellExecute()`.

 The [http://msdn.microsoft.com/en-us/library/bb762153(VS.85).aspx
 ShellExecute()] API is pretty horrible. For one thing it requires that you
 initialise COM. It's also full of string verbs and usless stuff related to
 documents and window visibility.

 I think what we should do is:
   * Use per-user installs by default
   * If the user does a --global install, check that we are running with
 administrator credentials and if not present a sensible error message. In
 particular this means not just an admin user, but running already with
 elevated privileges. That effectively means it must be run from within an
 elevated console window.

 See the section for console applications in [http://msdn.microsoft.com/en-
 us/library/bb756922.aspx this MSDN article].

Ticket URL: <http://hackage.haskell.org/trac/hackage/ticket/320#comment:9>
Hackage <http://haskell.org/cabal/>
Hackage: Cabal and related projects

More information about the cabal-devel mailing list