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

    Snapin Pack Arguments don't work

    Scheduled Pinned Locked Moved Solved Windows Problems
    3 Posts 2 Posters 595 Views
    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
      jlm
      last edited by jlm

      Hi

      My server’s config

      Ubuntu 22.04.5 LTS
      You're running the latest stable version: 1.5.10
      

      I’m trying to deploy snapin pack. These are third party zip file. They all have the same packaging format

      unzip 7-Zip_25.01-1_x64.zip 
      Archive:  7-Zip_25.01-1_x64.zip
        inflating: pre-install.ps1         
        inflating: post-install.ps1        
        inflating: install.bat             
        inflating: winsoft-config.ini      
        inflating: 7z2501-x64.msi          
        inflating: 7z2501-x64.exe
      

      The deployment entry point is always the install.bat script.

      What I’m trying to achieve

      I want to use either PowerShell (preferred) or batch, in order to launch the install.bat script from the "[FOG_SNAPIN_PATH]\7zip\" directory.
      This is very important because if the path is incorrect, the pre-install.ps1 and post-install.ps1 scripts will not run correctly.

      My snapin config for 7-zip as an example

      Snapin Name: 7zip
      Snapin Description: Installation de 7zip
      Snapin Type: 	Snapin Pack Template	
      Snapin Pack File: cmd.exe
      Snapin Pack Arguments: %~dp0 /c "[FOG_SNAPIN_PATH]\7zip\install.bat"
      Snapin File (exists): 7-Zip_25.01-1_x64.zip
      Snapin Enabled : x
      Snapin Arguments Hidden:	
      Snapin Timeout (seconds): 0
      Replicate?: x
      Reboot after install:	
      Shutdown after install:	
      Snapin Command read-only: cmd.exe %~dp0 /c "[FOG_SNAPIN_PATH]\7zip\install.bat"
      

      What I got

      In fact, as fog snapin has no debug mode, I have almost no clue to understand the failure. The Fog documentation is quite poor on this subject and is lacking examples.

      The logs from fog client on the computer

      23/09/2025 11:45:56 Client-Info Client Version: 0.13.0
      23/09/2025 11:45:56 Client-Info Client OS:      Windows
      23/09/2025 11:45:56 Client-Info Server Version: 1.5.10
      23/09/2025 11:45:56 Middleware::Response Success
      23/09/2025 11:45:56 SnapinClient Running snapin 7zip
      23/09/2025 11:45:56 Middleware::Communication Download: http://fog.example.com/fog/service/snapins.file.php?mac=8C:EC:4B:87:8A:4E&taskid=19
      23/09/2025 11:45:57 SnapinClient C:\Program Files (x86)\FOG\tmp\7-Zip_25.01-1_x64.zip
      23/09/2025 11:45:57 SnapinClient Processing SnapinPack 7-Zip_25.01-1_x64.zip
      23/09/2025 11:45:57 SnapinClient Extracting SnapinPack
      23/09/2025 11:45:57 Bus Emmiting message on channel: Notification
      23/09/2025 11:45:57 SnapinClient Starting snapin
      23/09/2025 11:45:57 SnapinClient Snapin finished
      23/09/2025 11:45:57 SnapinClient Return Code: 1
      23/09/2025 11:45:57 Bus Emmiting message on channel: Notification
      23/09/2025 11:45:57 Middleware::Communication URL: http://fog.example.com/fog/service/snapins.checkin.php?taskid=19&exitcode=1&mac=8C:EC:4B:87:8A:4E&newService&json
      

      I’ve tried a lot of Snapin Pack Arguments, either using PowerShell or cmd.exe, none of those installed the package.

      Doe anybody have clear examples of Snapin Pack Arguments ?

      Thanks

      1 Reply Last reply Reply Quote 0
      • J
        jlm
        last edited by

        Hi

        In fact, I really want to use those third party package because they do things very well
        My snapin configuration are not tied to a specific version of a package, it’s the upstream repo who take care of that

        But I have found how to install my install.bat file

        Here is the solution

        Snapin Name: 7zip
        Snapin Description: Installation de 7zip
        Snapin Type: 	Snapin Pack Template
        Snapin Pack Template : PowerShell x64 script
        Snapin Pack File: "%SYSTEMROOT%\sysnative\windowspowershell\v1.0\powershell.exe" # autofilled
        Snapin Pack Arguments: -ExecutionPolicy Bypass Set-Location "$env:ProgramFiles\FOG\tmp\7zip"; & ".\install.bat"
        Snapin File (exists): 7-Zip_25.01-1_x64.zip
        Snapin Enabled : x
        Snapin Arguments Hidden:	
        Snapin Timeout (seconds): 0
        Replicate?: x
        Reboot after install:	
        Shutdown after install:	
        Snapin Command read-only: "%SYSTEMROOT%\sysnative\windowspowershell\v1.0\powershell.exe" -ExecutionPolicy Bypass Set-Location "$env:ProgramFiles\FOG\tmp\7zip"; & ".\install.bat"  # autofilled
        

        It works like a charm

        Maybe it should go in FOG documentation as an example

        The third party repo I mentioned is there https://gricad-gitlab.univ-grenoble-alpes.fr/legi/soft/trokata/winsoft-main/

        LEGI is a French research lab, and the repo is under MIT Licence. I am not the owner, but it’s a great work. I will explain more about that later.

        1 Reply Last reply Reply Quote 0
        • C
          Clebboii
          last edited by Clebboii

          Hi there,

          Unsure if this helps, but here is my setup for 7zip. I usually just go straight from the .exe or .msi files.

          77e4dac6-5b21-4640-a6f6-25ecd52464a9-image.png

          Another example of snapin arguments:
          b2780d36-5dbd-429b-8fdc-3c71c8919ecb-image.png

          I would suggest adding in a loging function in the .bat or .ps1 file, this way you can see exactly what commands fail.

          Hope this helps!!

          1 Reply Last reply Reply Quote 0
          • J
            jlm
            last edited by

            Hi

            In fact, I really want to use those third party package because they do things very well
            My snapin configuration are not tied to a specific version of a package, it’s the upstream repo who take care of that

            But I have found how to install my install.bat file

            Here is the solution

            Snapin Name: 7zip
            Snapin Description: Installation de 7zip
            Snapin Type: 	Snapin Pack Template
            Snapin Pack Template : PowerShell x64 script
            Snapin Pack File: "%SYSTEMROOT%\sysnative\windowspowershell\v1.0\powershell.exe" # autofilled
            Snapin Pack Arguments: -ExecutionPolicy Bypass Set-Location "$env:ProgramFiles\FOG\tmp\7zip"; & ".\install.bat"
            Snapin File (exists): 7-Zip_25.01-1_x64.zip
            Snapin Enabled : x
            Snapin Arguments Hidden:	
            Snapin Timeout (seconds): 0
            Replicate?: x
            Reboot after install:	
            Shutdown after install:	
            Snapin Command read-only: "%SYSTEMROOT%\sysnative\windowspowershell\v1.0\powershell.exe" -ExecutionPolicy Bypass Set-Location "$env:ProgramFiles\FOG\tmp\7zip"; & ".\install.bat"  # autofilled
            

            It works like a charm

            Maybe it should go in FOG documentation as an example

            The third party repo I mentioned is there https://gricad-gitlab.univ-grenoble-alpes.fr/legi/soft/trokata/winsoft-main/

            LEGI is a French research lab, and the repo is under MIT Licence. I am not the owner, but it’s a great work. I will explain more about that later.

            1 Reply Last reply Reply Quote 0
            • J jlm has marked this topic as solved
            • 1 / 1
            • First post
              Last post

            145

            Online

            12.3k

            Users

            17.4k

            Topics

            155.8k

            Posts
            Copyright © 2012-2025 FOG Project