rake rawr:bundle:exe requires administrative permissions on Windows 7

78 views
Skip to first unread message

Sergey Moshnikov

unread,
Jan 28, 2011, 5:07:20 AM1/28/11
to rawr-lib
Hello everybody,

I've tried to use rawr on Windows 7, but it seems I can't create
an .exe file unless I am under the administrator account.

The output rake provides is (assuming I'm building a simple project
called 'rawr-test'):

================== [ START ] ============================
C:\Temp\rawr-test>rake rawr:bundle:exe
(in C:/Temp/rawr-test)
mkdir -p package/classes/java
javac -target 1.6 -cp lib/java/jruby-complete.jar;src -sourcepath src -
d package/classes/java src/org/rubyforge/rawr/Main.java
mkdir -p package/classes/ruby
Compile src/main.rb into package/classes/ruby/main.class
compile_dirs has src_dirs = ["src"]
glob_ruby_files has directory 'src' glob ["src/main.rb"]
files for src: 1
ruby_globs.each has glob_data = #<OpenStruct files=["main.rb"],
directory="src">
Go compile ["src/main.rb"]
Compiling src/main.rb to class main
mkdir -p package/classes/META-INF
mkdir -p package/jar
=== Creating jar file: package/jar/rawr-test.jar
cp lib/java/jruby-complete.jar package/jar/lib/java/jruby-complete.jar
mkdir -p package/windows
Creating Windows application in package/jar/rawr-test.exe
rake aborted!
The FSUTIL utility requires that you have administrative privileges.

(See full trace by running task with --trace)
================== [ END ] ============================

The workaround is running rake under the admin account, but it is
undesirable in an awful lot of situations :(

James Britt

unread,
Jan 29, 2011, 2:48:02 AM1/29/11
to rawr...@googlegroups.com
Sergey Moshnikov wrote:
> Hello everybody,
>
> I've tried to use rawr on Windows 7, but it seems I can't create
> an .exe file unless I am under the administrator account.
>
> The output rake provides is (assuming I'm building a simple project
> called 'rawr-test'):

How weird. I've never seen this, and then realized I run a Windows
shell app (console2) under admin privlideges. (I forget why, probably
because whatever I tend to do tends to trigger some annoying permision
thing a little too often.)

But I tried the rawr bundle task using a normal cmd.exe shell, and got
that error.

> The workaround is running rake under the admin account, but it is
> undesirable in an awful lot of situations :(
>

Or run a cmd shell as admin, and then what you do in that shell runs as
admin; you don't have to change any permissions on rake itself.

However, the idea of some sort of "sudo" command for Windows seemed
interesting, so I looked around some, and found this:

http://superuser.com/questions/42537/is-there-any-sudo-command-for-windows

I couldn't get the `runas` command to work for me, so I tried the
`elevate` tool linked over at
http://technet.microsoft.com/en-us/magazine/2007.06.utilityspotlight.aspx
(but the tool download is really here:
http://technet.microsoft.com/en-us/magazine/cc135869.aspx)

And it works.

It's less than ideal; you get the admin permission dialog box thing, and
then it runs the command in a new cmd window, which goes away after the
commnd runs. Maybe there's some way around the closing shell thing
(using `cmd \k` as part of the command string didn't help me, but my
WInFu is weak).

Having to install something extra is no fun either, though it sure beats
the busy `runas` syntax.


James

Jon Egil Strand

unread,
Jan 29, 2011, 6:18:30 AM1/29/11
to rawr...@googlegroups.com
On my windows 7 box I got the same error.

It is created by fsutil, which is used to check your filesystem type. Since the filesystem is always the same, I modified the code in the gem to skip the fsutil check, instead I hardcoded that I am using NTFS. Adios problemos.

Regards
Jon 





--
You received this message because you are subscribed to the Google Groups "rawr-lib" group.
To post to this group, send email to rawr...@googlegroups.com.
To unsubscribe from this group, send email to rawr-lib+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rawr-lib?hl=en.


James Britt

unread,
Jan 29, 2011, 12:59:26 PM1/29/11
to rawr...@googlegroups.com
Jon Egil Strand wrote:
> On my windows 7 box I got the same error.
>
> It is created by fsutil, which is used to check your filesystem type.
> Since the filesystem is always the same, I modified the code in the gem
> to skip the fsutil check, instead I hardcoded that I am using NTFS.
> Adios problemos.

I did a grep for this, and found nothing, and now I realize I cannot
spell.

If the code only works on NTFS anyway, is there a reason to have fsutil
bother checking? Would having rawr just fail if run on FAT32 (or
whatever) be a big deal?

Id rather just put a note in the docs ("NTFS only if on Windows") and
skip the hassle of running fsutil, unless there's some compelling reason
to keep it.

James

Jon Egil Strand

unread,
Jan 29, 2011, 4:53:18 PM1/29/11
to rawr...@googlegroups.com
I don't know if it fails on fat32. What I do know is that fsutil (which appearantly is to be deprecated by the way) requires admin rights, and I just bypassed that. 

IF it works on fat32, which I unfortunately can't test as I have no fat32 partition at hand, a config flag might be a good solution. If id fails on fat32 - I agree with mr Britt all the way.

Thanks
J



James

Reply all
Reply to author
Forward
0 new messages