FOG Project

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

    WAPT snapins

    Tutorials
    2
    4
    107
    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

      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 Reply Quote 1
      • F
        Florent last edited by

        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
        • J
          jmeyer @jmeyer last edited by jmeyer

          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
          • J
            jmeyer @jmeyer last edited by

            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 Reply Quote 1
            • 1 / 1
            • First post
              Last post

            190
            Online

            10.2k
            Users

            16.3k
            Topics

            149.9k
            Posts

            Copyright © 2012-2020 FOG Project