global env

set revn 140
set config 1

set i 0
foreach arg $argv {
   switch -glob -- $arg {
      -noconfig       { set config 0 }
      -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 ANSYSLIC_INSTALLDIR "$installDir\\Shared Files\\Licensing"

   set ANSYSLIC_PLATFORM ""
   if { [ string compare -nocase "$env(ANSYS_SYSDIR)" "intel" ] == 0 } {
       set ANSYSLIC_PLATFORM win32
   } else {
       set ANSYSLIC_PLATFORM $env(ANSYS_SYSDIR)
   }
   set env(ANSYSLIC_DIR) "C:\\Program Files\\ansys inc\\shared files\\licensing"

   #set cmdPath "$ANSYSLIC_INSTALLDIR\\$ANSYSLIC_PLATFORM\\APLConfig.exe"
   #puts "\nRunning $cmdPath /s"
   #exec $cmdPath /s
}
