It would be realy nice to be able to execute some custom scripts on events like "OnBeforeTriggerExecute", "OnAfterTriggerExecute" to add aditional functionality.
The reason why I would like this, is a current problem with the visual source safe trigger: As the build machine is in another domain then the vss file server, the build machine has no access to the vss share. In FB scripts this is not a problem, as I can map network drives specifing user and password to be used. But for thr VSS trigger I can not map a network drive previous to the trigger beeing run. If there where a OnBeforeTriggerExecute event, I could add some code to map the network drive.
Another nice feature would be, variables like %PROJECT_NAME%, %PROJECT_STATUS%, %LAST_TRIGGER%... for the "run process" triger (and others)
Another thing that might work, and give some other benefits, would be to load the windows user profile when starting the trigger thread/process (whatever you do) after authentication/impersonation. I think that should get windows to map the network drives, and the triggers and stuff would have access to their registry hive.
GetProfileType if RoamingProfile then begin //handle roaming users correctly NetUserGetInfo(Level 4) //get roaming profile path LoadUserProfile(token, PROFILEINFO.lpProfilePath := USER_INFO_4.usri4_profile) end else begin //else normal user profile on local machine LoadUserProfile(token, PROFILEINFO.lpProfilePath := null) end try RefreshPolicy //apply group policies WNetRestoreConnectionW //remap persistent network drives (use dynamic binding of dll on Vista) //
//do what ever you need with the impersonated token here // finally UnloadUserProfile end;
Also, when using CreateProcessAsUser with the impersonated token, make sure to call CreateEnvironmentBlock to get the "correct" environment variables.
The user’s profile and environment block are already loaded when we create the new process, so you should have access to the user’s registry hive as well as the correct environment variables. We are not currently using ‘WNetRestoreConnectionW’ as it does not appear to be supported under Windows Vista or greater, and I haven’t been able to work out an alternative. As a workaround though, I have added a new option to all the triggers that execute external processes that will allow you to map a network share before the process is started, this option is available in the latest test build, available from:
Almost perfect, but with a tiny little detail: There is no way to specify username and password to use. ;) The whole thing of mapping the drive, was to solve the "logon as user" problem. Else I could have used UNC path
My apologies for not getting back to you sooner, could you please try the following build and let me know whether you still receive the ‘SourceSafe INI directory “V:” does not exist.’ error message?
The last version fixed the "map network drive" problem.
But now I got a new one for you :
An unexpected error occurred testing trigger "SourceSafe" (Visual SourceSafe Trigger). Please report this error to support@finalbuilder.com.
System.IO.InvalidDataException: The input data is not in the expected format for a file repository change block. Input data: ***** Collector ***** Version 89 User: Cil Date: 13-11-08 Time: 14:15 $/Print Associates/IPCS/Development/Current/Investigator/Job Client/uSafePtrCheck.pas shared . at ..(String block) at ...ctor(String block, CultureInfo culture) at ..Create(String block, CultureInfo culture) at ..(String processOutput, CultureInfo culture) at ...ctor(String processOutput, CultureInfo culture) at VSoftTechnologies.FinalBuilderServer.Triggers.VssTrigger.GetModifiedFiles(String processOutput) at VSoftTechnologies.FinalBuilderServer.Triggers.BaseVersionControlTrigger.TestOutput(String processOutput, ITriggerOutput& output) at VSoftTechnologies.FinalBuilderServer.Triggers.BaseRunProcessTrigger.TriggerTest() at VSoftTechnologies.FinalBuilderServer.ServerAPI.TriggerDef.Test() at VSoftTechnologies.FinalBuilderServer.ServerAPI.ProjectDef.TestAllTriggers(ITriggerOutput& triggerOutput) This message has repeated 23 times since 14-11-2008 13:05.
The problem still exists. I attach the output at the end of this post.
Additionally I got some "The network BIOS session limit was exceeded" errors when trying to connect to a network share from the console. Maybe you are leaking sessions? Maybe in connection with other errors during the trigger execution the session started by connecting the drive (on trigger start) is not removed.
But here the ss error (FinalBuilder Server version 6.2.0.595)
An unexpected error occurred testing trigger "SourceSafe" (Visual SourceSafe Trigger). Please report this error to support@finalbuilder.com.
System.IO.InvalidDataException: The input data is not in the expected format for a file change block. Input data: ***** uTrace.pas ***** Version 91 User: Cil Date: 25-11-08 Time: 9:17 Checked in $/Print Associates/IPCS/Development/Current/Investigator/_UnitTest/JobParser . at ..(String block) at ...ctor(String block, CultureInfo culture) at ..Create(String block, CultureInfo culture) at ..(String processOutput, CultureInfo culture) at ...ctor(String processOutput, CultureInfo culture) at VSoftTechnologies.FinalBuilderServer.Triggers.VssTrigger.GetModifiedFiles(String processOutput) at VSoftTechnologies.FinalBuilderServer.Triggers.BaseVersionControlTrigger.TestOutput(String processOutput, ITriggerOutput& output) at VSoftTechnologies.FinalBuilderServer.Triggers.BaseRunProcessTrigger.TriggerTest() at VSoftTechnologies.FinalBuilderServer.ServerAPI.TriggerDef.Test() at VSoftTechnologies.FinalBuilderServer.ServerAPI.ProjectDef.TestAllTriggers(ITriggerOutput& triggerOutput) This message has repeated 3 times since 03-12-2008 10:30.
Would you be able to turn on trace logging so that I can get the exact output (specifically the formatting) from VSS so that we can get the parsing correct, you can do this by stopping the build service, opening 'FinalBuilderServer.exe.config' and adding the following to the 'appsettings' node:
< add value="true" key="TraceOutput" / >
When you re-start the build service a new text file will be created in the FinalBuilder Server program files directory which will hold the output from the triggers, if you could let the build service run for a while, while checking in files in version control we should be able to get enough sample data to make sure the parsing is correct. When there is enough output in the file, stop the build service and email the TraceOutput.txt file into support [at] finalbuilder.com.
I Created a new trigger for VSS (Visual Source Safe), I thought that this Trigger would detect any check-in I am performing in VSS but my tests never run.