• Recent
  • Unsolved
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Register
  • Login
  • Recent
  • Unsolved
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Register
  • Login

WAPT snapins

Scheduled Pinned Locked Moved
Tutorials
2
4
460
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J
    jmeyer
    last edited by jmeyer Oct 19, 2022, 11:24 PM Oct 19, 2022, 9:32 AM

    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

    J 1 Reply Last reply Oct 20, 2022, 5:27 AM Reply Quote 1
    • J
      jmeyer @jmeyer
      last edited by Oct 20, 2022, 5:27 AM

      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.

      J 1 Reply Last reply Oct 21, 2022, 11:40 AM Reply Quote 1
      • J
        jmeyer @jmeyer
        last edited by jmeyer Oct 21, 2022, 5:51 AM Oct 21, 2022, 11:40 AM

        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;
        		}
        	}
        }
        

        Snapin-General.png

        1 Reply Last reply Reply Quote 1
        • F
          Florent
          last edited by Nov 2, 2022, 8:17 AM

          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” ?

          Florent
          Bretagne, FRANCE

          1 Reply Last reply Reply Quote 0
          • 1 / 1
          • First post
            Last post

          148

          Online

          12.0k

          Users

          17.3k

          Topics

          155.2k

          Posts
          Copyright © 2012-2024 FOG Project