Forums

install-from-workspace

General discussion about Cobra. Releases and general news will also be posted here.
Feel free to ask questions or just say "Hello".

install-from-workspace

Postby Charles » Sun Oct 19, 2008 3:22 am

Hi everybody,

I need testing and feedback on a new installer I wrote for Cobra. It's located in the Subversion repository under the Source directory. You "cd" there and enter:

install-from-workspace

Or rather:

ins<TAB>

It does various things including building Cobra with -turbo, copying the files out to C:\Cobra\, versioning Cobra.Lang.dll and installing it to the GAC, etc. Also, I changed the -embed-run-time option to default to "no" which makes compilation snappier and Cobra EXEs smaller. If that's too much information, don't worry about it--the installer handles it all.

After the installation is done, you can invoke cobra from the command line outside the workspace.

I don't have it working on Mac/Linux/Unix yet, but made several allowances for that, and will get it working on that side of the fence at some point. You can get more information from the doc string at the top of InstallFromWorkspace.cobra, also in the same directory.

The installer works for me, but does it work for you? Please let me know.

If you don't have a Subversion workspace yet, see http://cobra-language.com/source/
Charles
 
Posts: 2515
Location: Los Angeles, CA

Re: install-from-workspace

Postby relez » Sun Oct 19, 2008 10:28 am

mmmmhhhh.... i tried this way

1) i went to cobra-workspace dir
2) svn up
3) cd source
4) install-from-workspace

the result is an error "cobra.lang.dll not found"....

No, maybe my way is not the right one.....
relez
 
Posts: 69

Re: install-from-workspace

Postby Charles » Sun Oct 19, 2008 1:35 pm

I made some tweaks.

Please "svn up" and try again.
Charles
 
Posts: 2515
Location: Los Angeles, CA

Re: install-from-workspace

Postby relez » Sun Oct 19, 2008 2:47 pm

If i start as "normal" user the answer is:

Unhandled Exception: System.ComponentModel.Win32Exception: The requested operati
on requires elevation
at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startIn
fo)
at System.Diagnostics.Process.Start()
at CommandLine.DoRun(List`1 paths)
at CommandLine.Run(List`1 args)
at CommandLine.Run()
at CobraMain.Main()

Then i open my prompt window as admin. The process starts and i think partially works but ends with (final lines):

run: cobra.exe -ert:no hello
Hello, world.

run: cobra.exe -ert:yes hello
Hello, world.

run: cobra.exe hello
Hello, world.

==== Install Cobra standard library to the GAC

Searching for gacutil...
** ERROR: Cannot locate a gacutil. Maybe you can try again using the "Visual Stu
dio Command Prompt".
relez
 
Posts: 69

Re: install-from-workspace

Postby relez » Sun Oct 19, 2008 2:52 pm

.....then i tried from VS2008 prompt.... fault as in the first step of previous message....
then i tried using VS2008 command prompt as admin.... success! with this end:


run: cobra.exe -bsl -debug
Compilation succeeded

==== Install "cobra" into a system path directory


The Cobra compiler is not in your PATH. To remedy you can:
1. Add C:\Cobra\bin to your PATH
2. Copy C:\Cobra\bin\cobra.bat to any directory in your PATH

Success!

I'm going to fix my path....
relez
 
Posts: 69

Re: install-from-workspace

Postby relez » Sun Oct 19, 2008 3:03 pm

Ok, path fixed... it seems to work fine. The end:

run: cobra.exe -bsl -debug
Compilation succeeded

==== Install "cobra" into a system path directory

found in PATH: c:\Users\RL\cobra\bin\cobra.bat

copy from: C:\Cobra\bin\cobra.bat
to: c:\Users\RL\cobra\bin\cobra.bat

The existing "cobra" in your path has been replaced
with the new one.

Success!

Sorry for the step-by-step test.... my pc is a battlefield....
relez
 
Posts: 69

Re: install-from-workspace

Postby Charles » Sun Oct 19, 2008 3:27 pm

No apologies necessary. This is good information. I conclude that:

-- When Cobra attempts to run a program, it should look for the "requires elevation" exception and give a better error message.

-- The gacutil problem should be detected up front.

-- I should add the typical VS 2008 gacutil path in the autosearch for it (right now it just searches for the VS 2005 path)

Great!

Btw I'm not familiar with Vista. Does anyone know if there is some way to tell Vista that it's okay for cobra.exe to start another process?


-Chuck
Charles
 
Posts: 2515
Location: Los Angeles, CA

Re: install-from-workspace

Postby relez » Sun Oct 19, 2008 3:44 pm

Chuck wrote:Btw I'm not familiar with Vista. Does anyone know if there is some way to tell Vista that it's okay for cobra.exe to start another process?


Recently i read this paper
http://visualstudiomagazine.com/columns ... alsid=2337

but I'm not sure that it is somehow useful for that problem.....
relez
 
Posts: 69

Re: install-from-workspace

Postby Charles » Sun Oct 19, 2008 7:09 pm

I've made improvements to Cobra and to the installer based on your experiences.

I'm looking forward to another round of feedback from the next user. Please let me know how it goes, good or bad.

-Chuck
Charles
 
Posts: 2515
Location: Los Angeles, CA

Re: install-from-workspace

Postby Charles » Sun Oct 19, 2008 7:33 pm

Hi relez, I read the paper and don't think that it really applies. But it was an interesting read. Here are my thoughts:

First, I'm surprised that simply launching another program requires admin privs. Especially a .exe that was output by the same process trying to launch it! The article doesn't address that.

Second, their approaches are:
1 - Remove the functionality. (Not feasible.)
2 - Move the functionality to another process. (We're trying to launch the other process! Not feasible.)
3 - Run as admin (See below.)

I sort of addressed 3 by including a Windows Vista hint if Cobra gets an exception about "elevation" when trying to launch the .exe it produced. See the short changeset:1690

I didn't take the GUI shield approach described in the article because it's not appropriate for the command line.

I noticed she mentioned that she runs her debugging sessions as admin. But debugging a program you wrote is not a system administration task. I think developers on Vista will just have to get used to this weirdness.

Thanks for the link,

-Chuck
Charles
 
Posts: 2515
Location: Los Angeles, CA

Next

Return to Discussion

Who is online

Users browsing this forum: No registered users and 52 guests