Date de création : 20/09/24
Date de Mise à Jour : 20/09/24
$downloadUrl = "https://analys-informatique.com/TS2Log/TS2Log-GALANA.zip"; $downloadUrlForConnectFile = "https://analys-informatique.com/TS2Log/CustomerName/Galana.connect.zip"; $downloadPath = "C:\Temp"; $downloadFile = "C:\Temp\TS2Log-GALANA.zip"; $ts2LogClientExePath = $downloadPath + "\TS2Log-Galana\Setup-ConnectionClient.exe"; $VirtualPrinterExePath = $downloadPath + "\TS2Log-Galana\Setup-VirtualPrinter-Client.exe"; $clientName = Read-Host -Prompt 'Nom Client' if (! (Test-Path $downloadPath)) { New-Item -ItemType Directory -Path $downloadPath; } if (! (Test-Path $downloadFile)) { Invoke-WebRequest $downloadUrl -OutFile $downloadFile; } Expand-Archive $downloadFile -DestinationPath $downloadPath; Start-Process -FilePath $ts2LogClientExePath -ArgumentList "/CURRENTUSER" -Wait; if ($args[0]) { if ($args[0] = "InstallVirtualPrinter") { Start-Process -FilePath $VirtualPrinterExePath -ArgumentList "/CURRENTUSER" -Wait; } } $documentPath = [environment]::GetFolderPath('MyDocuments'); $connexionPath = $documentPath + "\Mes Connexions"; $connexionFile = $connexionPath + "\Galana.connect"; if (! (Test-Path $connexionPath)) { New-Item -ItemType Directory -Path $connexionPath; } $downLoadConnectFileUrl = $downloadUrlForConnectFile.Replace("CustomerName", $clientName); Invoke-WebRequest $downLoadConnectFileUrl -OutFile $connexionFile; $icoFile = $downloadPath + "\TS2Log-Galana\Galana.ico" Copy-Item $icoFile -Destination $connexionPath $DesktopPath = [Environment]::GetFolderPath("Desktop"); $ShortcutTarget= $connexionFile; $ShortcutFile = $DesktopPath + "\GALANA.lnk"; $WScriptShell = New-Object -ComObject WScript.Shell; $Shortcut = $WScriptShell.CreateShortcut($ShortcutFile); $Shortcut.TargetPath = $ShortcutTarget; $Shortcut.IconLocation = $connexionPath + "\Galana.ico"; $Shortcut.Save(); Remove-Item $downloadFile; $pathToDelete = $downloadPath + "\TS2Log-Galana"; Remove-Item $pathToDelete -Force -Recurse;
Si vous souhaitez imprimer instantanément depuis votre session Galana sur votre imprimante locale, installer l'outil Virtual printer. Pour cela :