views:

35

answers:

1

Rather than build a whole project group (several DLLs and an executable) I want to run the group from the command line like this: VB6 /runexit project

It eliminates the compile step and keeps the registry clean.

I can setup a Hudson job which gets the latest code from source control and runs the command line. The problem I've run into is that the target program hangs up part way through. I can abort it through the Hudson web interface OK.

What is happening?

A: 

The actual problem being encountered here is that VB6 looks to the registry for some of its system settings. When you run the project yourself, VB picks up settings from your user. When Hudson runs as a service it logs in as Local System, which has its own registry settings.

The VB6 setting that is relevant here is Options/ErrorTrapping. By default the registry contains 'Break on All Errors'. The project in question requires 'Break on Unhandled Errors'. The symptom seems to be that VB6 locks up when an error is raised.

The solution involves exporting the relevant settings from my user and importing them to Local System.

There is an answer with a link about running regedit under Local System, but my answer is to use Hudson itself to run regedit as Local System. Also there is a question here about vb6 ide settings.

  1. Use a Command Window to export VB settings from this key to a file like this:

    regedit /e vbide-1.reg "HKEY_CURRENT_USER\Software\Microsoft\VBA\Microsoft Visual Basic"

  2. Create a new job in Hudson which does nothing for now, but click Build Now to create a job folder.

  3. Find the folder it creates and copy vbide-1.reg to the 'workspace' folder there.

  4. Configure the Hudson job to execute this Windows batch command:
    regedit /s vbide-1.reg

  5. Click Build Now again and the batch command should run. Verify in the Console Output:
    ...\workspace>regedit /s vbide-1.reg

  6. Disable the Build, or just delete the project.

quamrana
Since it hangs when compiling with the wrong setting, what will happen when it has an compile error when compiling with the right settings? Will it hang than too? If so, you should look for a different solution. The build is not allowed to hang, doesn't metter if the build is successful or not. --- Another thought is the local_system account. This account has way to much permissions. You shpuld think about creating a special user for your Hudson instance and run the service as that user. Otherwise everyone who can configure a job in Hudson has admin permissions on your Hudson server.
Peter Schuetze
Ok, I'll look out for the compile error thing. I'm just experimenting for now, so the permissions doesn't matter now.
quamrana