To optimize the launch of the application via VPN, it is possible to place the complete CAQdesktop directory on the user's local disk and thus greatly increase the start up speed of the application. The application itself will only download data from the MSSQL server via VPN. It is also a good idea to set a default filter for a specific module to limit the amount of data to load at startup.
However, this boot solution complicates the actual upgrade of the CAQdesktop application, where it is necessary to ensure the same versions on all stations. One option is to use the script below, which users will use to launch the application. The script checks and compares the local network directories with the application and and according to that decides whether it is necessary to update the local copy from which it then starts the program itself.
When performing an update on the server, it is necessary to indentify users currently working with Palstat CAQdesktop and promt them to close the application on local stations, otherwise there may arrise a situation where the databsae structure on the server changes and an applicatation that has not been updated may lead an unpredictable error state.
The list of users currently working in the system can be located using the apllication ./APL/CaqAdmin.exe under the "License" tab, see screenshot.
Launch the Launcher
C:/Windows/System32/WindowsPowerShell/v1.0/powershell.exe -ExecutionPolicy Bypass -File "c:/Palstat3G_local_production/RUN_Palstat.ps1"
Starting the Gauges module
inserting the module name at the end of the "measures" command corresponds to the name according to the EXE files in the APL directory.
C:/Windows/System32/WindowsPowerShell/v1.0/powershell.exe -ExecutionPolicy Bypass -File "c:/Palstat3G_local_production/RUN_Palstat.ps1" measures
Download sample shortcuts in ZIP format
Example of a local directory on a client station, shortcuts can be placed on a network drive for easier management, or extended script and copied shortcuts from a network drive to local workstations.
cls
<#
v1.3 - add Set-Location
v1.2 - accept custom config.xml file for local users
v1.1 - external argument as runable programm
v1.0 - first release
#>
$sourcePalstatDir = "//10.0.01/VPN/Palstat3G/"; # demand # network directory of CAQdesktop
$targetPalstatDir = "c:/Palstat3G_local_production/"; # demand # local directory
$targetPalstatClientConfig = "config.LocalClient.xml"; # optional # name of custom config file for users with local copy of CAQdesktop
$sourcePalstatRelease = $sourcePalstatDir + "APL/release.xml";
$targetPalstatRelease = $targetPalstatDir + "APL/release.xml";
"
-----------------------------------------------------------------
- PalstatCAQ LOCAL COPY CHECK
- compare, copy, run both Palstat Directory
- ergument represent name of module exp: 'measures'
-
- SOURCE: $sourcePalstatDir
- TARGET: $targetPalstatDir
- ARGUMENTS: $($args.count)
-----------------------------------------------------------------
"
if ( $($args.count) -eq 1 ) {
$arg_file = $sourcePalstatDir+"APL/"+$($args[0])+".exe";
$arg_file2 = $targetPalstatDir+"APL/"+$($args[0])+".exe";
"[I]: Script accepted argument"
"[I]: Argument -> $($args[0])"
"[I]: Argument -> $arg_file"
#hledame zda takovy soubor vubec existuje
if (!(Test-Path $arg_file) -and !(Test-Path $arg_file2) ) {
"[E]: Argument -> file not exist -> $arg_file"
exit;
}else{
$_run_argument = $arg_file2;
}
}else{
$_run_argument = "NO";
}
"[I]: Check release.xml files in source and target directory"
if (!(Test-Path $targetPalstatRelease) ) {
"[W]: NOT EXIST Target Directory '$targetPalstatDir'"
New-Item -Path "$targetPalstatDir" -Name "APL" -ItemType "directory" | Out-Null
New-Item -Path "$targetPalstatDir/APL/" -Name "release.xml" -ItemType "file" -Value "First RUN" | Out-Null
"[I]: Directory Created"
}
if (!(Test-Path $sourcePalstatRelease) ) {
"[E]: NOT EXIST -> $sourcePalstatRelease"
exit;
}
if (!(Test-Path $targetPalstatRelease) ) {
"[E]: NOT EXIST -> $targetPalstatRelease"
}
"[I]: OK"
if(Compare-Object -ReferenceObject $(Get-Content $targetPalstatRelease) -DifferenceObject $(Get-Content $sourcePalstatRelease)){
"[I]: Versions are different, copy actual from server!!!"
if ((Test-Path "$targetPalstatDir/APLOLD/") ) {
Remove-Item "$targetPalstatDir/APLOLD/" -Recurse
}
#### zkusime prejmenovat jestli neni slozka nekym drzena
if ((Test-Path "$targetPalstatDir/APL/") ) {
"[I]: Old APL exist, try rename to check if isnt block"
Rename-Item -path "$targetPalstatDir/APL" -newName "$targetPalstatDir/APLOLD" | Out-Null
if (!(Test-Path "$targetPalstatDir/APLOLD/") ) {
"[E]: unable rename '$targetPalstatDir/APL', some application is open?"
exit;
}
}
if ((Test-Path "$targetPalstatDir/CONFIG/") ) {
"[I]: Delete Dir CONFIG - done"
Remove-Item "$targetPalstatDir/CONFIG/" -Recurse
}
New-Item -Path "$targetPalstatDir" -Name "CONFIG" -ItemType "directory" | Out-Null
if ((Test-Path "$targetPalstatDir/APL/") ) {
"[I]: Delete Dir APL - done"
Remove-Item "$targetPalstatDir/APL/" -Recurse
}
New-Item -Path "$targetPalstatDir" -Name "APL" -ItemType "directory" | Out-Null
if ((Test-Path "$targetPalstatDir/DOC/") ) {
"[I]: Delete Dir DOC - done"
Remove-Item "$targetPalstatDir/DOC/" -Recurse
}
New-Item -Path "$targetPalstatDir" -Name "DOC" -ItemType "directory" | Out-Null
if ((Test-Path "$targetPalstatDir/SETUP/") ) {
"[I]: Delete Dir SETUP - done"
Remove-Item "$targetPalstatDir/SETUP/" -Recurse
}
New-Item -Path "$targetPalstatDir" -Name "SETUP" -ItemType "directory" | Out-Null
Copy-Item -Path "$sourcePalstatDir/CONFIG/*" -Destination "$targetPalstatDir/CONFIG" -Recurse
"[I]: Copy Dir CONFIG - done"
Copy-Item -Path "$sourcePalstatDir/SETUP/*" -Destination "$targetPalstatDir/SETUP" -Recurse
"[I]: Copy Dir SETUP - done"
Copy-Item -Path "$sourcePalstatDir/DOC/*" -Destination "$targetPalstatDir/DOC" -Recurse
"[I]: Copy Dir DOC - done"
Copy-Item -Path "$sourcePalstatDir/APL/*" -Destination "$targetPalstatDir/APL" -Recurse
"[I]: Copy Dir APL - done"
}
#run CAQdesktop from local destination
if ((Test-Path $targetPalstatRelease) ) {
if ( !([string]::IsNullOrWhitespace($targetPalstatClientConfig)) ) {
"[I]: Local custom config file -> defined"
$customCfg = $sourcePalstatDir+"CONFIG/"+$targetPalstatClientConfig;
if ((Test-Path $customCfg) ) {
"[I]: Local custom config file -> delete old file from local destination"
Remove-Item "$targetPalstatDir/CONFIG/config.xml" | Out-Null
"[I]: Local custom config file -> copy to local destination"
Copy-Item -Path "$customCfg" -Destination "$targetPalstatDir/CONFIG/config.xml" | Out-Null
}else{
"[W]: Local custom config file -> defined but not exist "+$customCfg
}
}else{
"[I]: Local custom config file -> NOdefined"
}
Set-Location "$targetPalstatDir/APL"
if ( $_run_argument -eq "NO" ){
"[I]: Versions are same, RUN LAUNCHER"
&"$targetPalstatDir/APL/Launcher.exe"
}else{
"[I]: Versions are same, RUN ARGUMENT"
&$_run_argument
}
}
##
![]() |
© Copyright 1992 - 2025 PALSTAT s.r.o. |
PALSTAT s.r.o. Bucharova 230 543 02 Vrchlabí CZECH REPUBLIC |
tel.: +420 499 422 044 tel.: +420 499 692 016 www.palstat.cz |
» Home Page » Training » References » News |
» Events » Partners » Support » Contact |
» Products » Customer portal » Remote support » Update |
» Terms and Conditions » Gallery » Map » Portal 3 |