global env

set revn 140
set config 1

set i 0
foreach arg $argv {
   switch -glob -- $arg {
      -noconfig       { set config 0 }
      -sourcedir      { set sourceDir       [lindex $argv [expr $i + 1]] }
      -installdir     { set installDir       [lindex $argv [expr $i + 1]] }
      -rev            { set revn             [lindex $argv [expr $i + 1]] }
      -scripttosource { set scripttosource   [lindex $argv [expr $i + 1]] }
   }
   incr i
}

catch {source $scripttosource}

if { $config == 1 } {
   set config_dir "$sourceDir\\EKM\\server"
   set cmdPath "$config_dir\\AnsConfigEKMSvr.exe"
   puts "\nRunning $cmdPath"
   exec $cmdPath -install
}
