RE: [Haskell-cafe] Cabal install on Windows 7

2009-09-15 Thread Regis Saint-Paul
- use windows API for requesting elevation during the process (ugly) If it really has to be done, then this seems like the best approach. In principle there's no problem with calling funky win32 functions in Cabal, it's mostly a matter of working out what bahaviour we want and what UAC

Re: [Haskell-cafe] Cabal install on Windows 7

2009-09-15 Thread Peter Verswyvelen
It is possible for an executable with less privileges to shellexecute an executable that requires admin rights? Won't this immediately raise an access denied or other security exception again? Don't know, it might be possible, but it's worth to check it out before going this route (which is rather

Re[2]: [Haskell-cafe] Cabal install on Windows 7

2009-09-15 Thread Bulat Ziganshin
Hello Peter, Tuesday, September 15, 2009, 1:24:26 PM, you wrote: in order to protect from viruses and so now windows programs should be split into two parts - one that doesn't need admin privileges and one that needs them. as far as your actions doesn't need second part, you are running first

Re: Re[2]: [Haskell-cafe] Cabal install on Windows 7

2009-09-15 Thread Peter Verswyvelen
Yes, I'm aware of that, but not the details, so thanks for the info. Anyway, I quickly tested Regis's idea in C#, and it works as he said. http://hpaste.org/fastcgi/hpaste.fcgi/view?id=9392#a9392 - When trying to create a folder in ProgramFiles, you get an access denied exception, unless the

RE: [Haskell-cafe] Cabal install on Windows 7

2009-09-14 Thread Duncan Coutts
On Thu, 2009-09-10 at 15:18 +0200, Regis Saint-Paul wrote: One way in which cabal can be made UAC aware (and therefore request for elevation privileges instead of just failing) would be to embed a manifest in the cabal.exe. This can be done by changing the default manifest (an XML file) that

Re: [Haskell-cafe] Cabal install on Windows 7

2009-09-10 Thread Peter Verswyvelen
Actually, this UAC was already present in Vista no? On Thu, Sep 10, 2009 at 4:18 AM, Jeff Wheeler j...@nokrev.com wrote: On Wed, Sep 9, 2009 at 2:19 PM, Sebastian Sylvansebastian.syl...@gmail.com wrote: I think it's morally right to run as user by default. Yes, the windows culture has some

Re: [Haskell-cafe] Cabal install on Windows 7

2009-09-10 Thread Peter Verswyvelen
Interestingly, a sudo for Windows does seem to exist. It's called the runas command. At first sight it existed already since Windows XP Also on Sourceforge an open source sudo command for Windows is hosted: http://sourceforge.net/projects/sudowin On Thu, Sep 10, 2009 at 11:21 AM, Peter

Re: [Haskell-cafe] Cabal install on Windows 7

2009-09-10 Thread Duncan Coutts
On Wed, 2009-09-09 at 20:19 +0100, Sebastian Sylvan wrote: On Wed, Sep 9, 2009 at 1:28 PM, Duncan Coutts duncan.cou...@worc.ox.ac.uk wrote: If the Windows users can come to a consensus on whether the default should be global or user, then we can easily switch

Re: [Haskell-cafe] Cabal install on Windows 7

2009-09-10 Thread Sebastian Sylvan
On Thu, Sep 10, 2009 at 10:58 AM, Duncan Coutts duncan.cou...@worc.ox.ac.uk wrote: On Wed, 2009-09-09 at 20:19 +0100, Sebastian Sylvan wrote: On Wed, Sep 9, 2009 at 1:28 PM, Duncan Coutts duncan.cou...@worc.ox.ac.uk wrote: If the Windows users can come to a consensus on

Re: [Haskell-cafe] Cabal install on Windows 7

2009-09-10 Thread Duncan Coutts
On Wed, 2009-09-09 at 21:18 -0500, Jeff Wheeler wrote: On Wed, Sep 9, 2009 at 2:19 PM, Sebastian Sylvansebastian.syl...@gmail.com wrote: I think it's morally right to run as user by default. Yes, the windows culture has some legacy that may, on occasion, make it slightly harder to use

Re: [Haskell-cafe] Cabal install on Windows 7

2009-09-10 Thread Deniz Dogan
2009/9/10 Sebastian Sylvan sebastian.syl...@gmail.com: On Thu, Sep 10, 2009 at 10:58 AM, Duncan Coutts duncan.cou...@worc.ox.ac.uk wrote: On Wed, 2009-09-09 at 20:19 +0100, Sebastian Sylvan wrote: On Wed, Sep 9, 2009 at 1:28 PM, Duncan Coutts duncan.cou...@worc.ox.ac.uk wrote:  

Re: [Haskell-cafe] Cabal install on Windows 7

2009-09-10 Thread Peter Verswyvelen
No Windows XP did not have support for roaming profiles yet I think. But it wouldn't be too difficult to use %LOCALAPPDATA% first, and when it doesn't exist, use %APPDATA%? This article explains a lot about the differences; I didn't have time yet to read it in detail

RE: [Haskell-cafe] Cabal install on Windows 7

2009-09-10 Thread Regis Saint-Paul
One way in which cabal can be made UAC aware (and therefore request for elevation privileges instead of just failing) would be to embed a manifest in the cabal.exe. This can be done by changing the default manifest (an XML file) that is embedded at link time by GHC. This is supported by GHC

Re: [Haskell-cafe] Cabal install on Windows 7

2009-09-10 Thread Matthijs Kooijman
Hi Regis, - use windows API for requesting elevation during the process (ugly) Why is this ugly? This seems like an elegant solution, to get privileges only when you actually need them? Gr. Matthijs signature.asc Description: Digital signature ___

Re[2]: [Haskell-cafe] Cabal install on Windows 7

2009-09-10 Thread Bulat Ziganshin
Hello Matthijs, Thursday, September 10, 2009, 5:24:57 PM, you wrote: - use windows API for requesting elevation during the process (ugly) Why is this ugly? This seems like an elegant solution, to get privileges only when you actually need them? afaik you need to run special COM server with

RE: [Haskell-cafe] Cabal install on Windows 7

2009-09-10 Thread Regis Saint-Paul
builds down to more work and more platform specific code. Cheers, Regis -Original Message- From: Matthijs Kooijman [mailto:matth...@stdin.nl] Sent: Thursday, 10 September 2009 3:25 PM To: Regis Saint-Paul Cc: haskell-cafe@haskell.org; 'Duncan Coutts' Subject: Re: [Haskell-cafe] Cabal

RE: [Haskell-cafe] Cabal install on Windows 7

2009-09-10 Thread Regis Saint-Paul
One last note as it may be confusing in previous message...I mention to use windows API, but there is no API per-se that can elevate a process already running. It takes to create another process which, at startup time, will popup the elevation dialog. The win32 function to call is therefore just

Re[2]: [Haskell-cafe] Cabal install on Windows 7

2009-09-10 Thread Bulat Ziganshin
Hello Regis, Thursday, September 10, 2009, 6:05:19 PM, you wrote: One last note as it may be confusing in previous message...I mention to use windows API, but there is no API per-se that can elevate a process already running. It takes to create another process which, at startup time, will

Re: [Haskell-cafe] Cabal install on Windows 7

2009-09-09 Thread Duncan Coutts
On Tue, 2009-09-08 at 09:58 -0500, Jeff Wheeler wrote: On Tue, Sep 8, 2009 at 9:17 AM, Peter Verswyvelenbugf...@gmail.com wrote: Ouch, right, I forgot the default is global. It works fine with cabal install --user. And of course I could have edited the default config file, setting

Re: [Haskell-cafe] Cabal install on Windows 7

2009-09-09 Thread Peter Verswyvelen
Yes, it's true that most people tended to be administrators on their own Windows desktops, but since Vista, this has changed. Now in Vista, some people still forced admin rights, to get rid of the many annoying dialog boxes that popped up for every tiny task that might be a security breach. But

Re: [Haskell-cafe] Cabal install on Windows 7

2009-09-09 Thread Duncan Coutts
On Wed, 2009-09-09 at 16:59 +0200, Peter Verswyvelen wrote: Yes, it's true that most people tended to be administrators on their own Windows desktops, but since Vista, this has changed. Now in Vista, some people still forced admin rights, to get rid of the many annoying dialog boxes that

Re: [Haskell-cafe] Cabal install on Windows 7

2009-09-09 Thread Sebastian Sylvan
On Wed, Sep 9, 2009 at 1:28 PM, Duncan Coutts duncan.cou...@worc.ox.ac.ukwrote: On Tue, 2009-09-08 at 09:58 -0500, Jeff Wheeler wrote: On Tue, Sep 8, 2009 at 9:17 AM, Peter Verswyvelenbugf...@gmail.com wrote: Ouch, right, I forgot the default is global. It works fine with cabal

Re: [Haskell-cafe] Cabal install on Windows 7

2009-09-09 Thread Jeff Wheeler
On Wed, Sep 9, 2009 at 2:19 PM, Sebastian Sylvansebastian.syl...@gmail.com wrote: I think it's morally right to run as user by default. Yes, the windows culture has some legacy that may, on occasion, make it slightly harder to use well behaved programs, but it's fairly minor these days. I

[Haskell-cafe] Cabal install on Windows 7

2009-09-08 Thread Peter Verswyvelen
I tried the cabal install command on Windows 7, and I had to run it with administrative privileges, otherwise I got access denied (it failed to create the Haskell folder in C:\Program Files) Not sure if this is also the case on Vista. Is this the intended behavior?

Re: [Haskell-cafe] Cabal install on Windows 7

2009-09-08 Thread Jeff Wheeler
On Tue, Sep 8, 2009 at 9:17 AM, Peter Verswyvelenbugf...@gmail.com wrote: Ouch, right, I forgot the default is global. It works fine with cabal install --user. And of course I could have edited the default config file, setting user-install: True Well, maybe for newbies this might be a bit

Re: [Haskell-cafe] Cabal install on Windows 7

2009-09-08 Thread Peter Verswyvelen
Ouch, right, I forgot the default is global. It works fine with cabal install --user. And of course I could have edited the default config file, setting user-install: True Well, maybe for newbies this might be a bit confusing. Typically, under Windows Vista or 7 when you try to install something

Re: [Haskell-cafe] Cabal install on Windows 7

2009-09-08 Thread John Van Enk
Might it make sense to try and get the concept of global and user working in Windows? (It may already, but I noticed that the default seems to be global.) I don't know what technical challenges there are, but the ApplicationData directory (or AppData, or whatever) seems like a good place to stick