SetConsole("HIDE")
; Declaring variables
;
; PZB = defines what PZB path will be set within CER.ini
; CER = defines where our user's CER.ini file is saved too, and looked for
; PFX = defines the value for PFX for claimsview
; MENU = defines the value for Menu for Claimsview
;
$pzb="\\root\Production$$"
$cer="\\root\userconfigs$$\@userid\Production"
$pfx="0001"
$Menu="Y"
;
;
$Message=" You are not allowed to run more than two copies of OurApp. "
; Checking for Cer.ini, copying it if it's not there.
;
IF NOT Exist ("\\root\userconfigs$$\@userid")
MD "\\root\userconfigs$$\@userid"
EndIf
;
IF NOT Exist ("$cer\cer.ini")
MD "$cer"
Copy "\\root\cer$$\cer.ini" "$cer"
writeprofilestring ("$cer\cer.ini", "System", "PzbPath", "$pzb")
EndIf
;
writeprofilestring ("$cer\cer.ini", "CLAIMVIEW", "PFX", "$pfx")
writeprofilestring ("$cer\cer.ini", "ClAIMVIEW", "MENU", "$menu")
;
;
$MaxSess=2
$Tasklist='tasklist /FI "Username eq %USERDOMAIN%\%USERID%" /FI "Imagename eq App.exe"'
$aResult=WshPipe($Tasklist)
;
If UBound($aResult) < ($MaxSess +1)
Run "C:\appname\app\app.exe $cer\cer.ini"
Else
MessageBox ("$Message"," ***You are not allowed to run more than two App sessions*** ",0,10)
EndIf
;
Exit