WAPT snapins
-
Hello,
I am working on WAPT packages import directly in snapins.
I am writing single line powershell script to rename to zip, extract to directory, find command and run it.This is my first test script for VLC from windows :
$packwapt = "tis-vlc_3.0.16-12_x64_windows_0f4137ed1502b5045d6083aa258b5c42_5.1_PROD.wapt"; $packname = [System.IO.Path]::GetFileNameWithoutExtension($packwapt); Copy-Item $packwapt $packname".zip"; Expand-Archive -LiteralPath $packname".zip" $packname; Remove-Item $packname".zip"; $s = Get-Content -Path $packname"\setup.py" | Select-String -Pattern "silentflags = "; if ($s -ne $null) { $s=[regex]::matches($s,'(?<=\").+?(?=\")').value; Get-ChildItem -Filter $packname"\*.exe" | ForEach {&$_.Fullname $s} }; Remove-Item $packname –recurse;
I’m not sure where I am going and if this is useful… lol
-
Caling powershell.exe doesn’t allow to set variable directly ($var=“test”).
I had to use Set-Variable command but multi commands doesn’t work as expected since every line need a command.
I’ll keep trying to work on this.
-
I have review my first idea.
I have used Snapin Pack.
Zip the wapt and the ps1 script and it’s working for VLC WAPT package.Get-ChildItem -Filter '*.wapt' | ForEach { Set-Variable -Name packwapt -Value $_.Fullname Set-Variable -Name packname -Value $packwapt.Substring(0,$packwapt.Length-5) Copy-Item $packwapt $packname'.zip' Expand-Archive -LiteralPath $packname'.zip' $packname Set-Variable -Name s -Value (Get-Content -Path $packname'\setup.py' | Select-String -Pattern 'silentflags = ') if ($s -ne $null) { Set-Variable -Name s -Value ([regex]::matches($s,'(?<=\").+?(?=\")').value) Get-ChildItem -Path $packname -Filter '*.exe' | ForEach { Start-Process -FilePath $_.Fullname $s -Wait; } } }
-
I use WAPT to deploy softwares but i don’t understand your use case.
Why not just deploy WAPT agent and use command like “wapt-get install tis-yourPackage” ?