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

    Batch file snapin install

    Scheduled Pinned Locked Moved Solved
    Windows Problems
    4
    14
    3.6k
    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.
    • D
      dureal99d
      last edited by dureal99d

      server: 16.04.1 ubuntu.
      client: 11.7
      fog version: RC-36
      os attempting to deploy to: windows 10

      Batch script snapin install?

      I have this file of games that installs perfectly from within windows when executed. but when i try to do the same as a snapin, it downloads ,extracts ,states that it is installing and then as soon as it says installing, it says installed, but no program is installed.

      The fog log say error code 1

      I just dont now what im doing wrong?

      its clear to me its something simple i just cant seem to put my finger on it

      Could i get some help on the matter please.

      screen shot of snapin window
      0_1482016094800_batch.jpg

      here is the batch/cmd file contents:

      @echo off
      Echo Wscript.Sleep 5000>"%Temp%\Wait.vbs"
      Echo WScript.Quit>>"%Temp%\Wait.vbs"
      Echo Installing Game Pack...
      Echo.
      For /f "tokens=*" %%a in ('dir /b /on "*[PopCap][ExtremlymTorrents.Me].exe"') do (
      Echo Installing %%~na...
      Echo.
      Start "" /wait Wscript "%Temp%\Wait.vbs"
      Start "" /wait "%%a" /S
      )
      Del "%Temp%\Wait.vbs"```
      1 Reply Last reply Reply Quote 0
      • D
        dureal99d @dureal99d
        last edited by

        @Joe-Schmitt @Wayne-Workman @Tom-Elliott I thank you guys for the help but the original script worked just fine.

        I believe this one was an user error and in this case me being that user.

        When I made the snapin pack I messed up in how I told fog to execute the bat file inside by not telling fog that it had another folder to prior to trying to execute the bat file. as you can see from my original post I had simply _install.bat"
        when in reality it was popcap/_install.bat I have since then repacked the .zip file with no other folder in the way and simplified the bat file by naming it simply pop.bat all with the original coding @echo off Echo Wscript.Sleep 5000>"%Temp%\Wait.vbs" Echo WScript.Quit>>"%Temp%\Wait.vbs" Echo Installing Game Pack... Echo. For /f "tokens=*" %%a in ('dir /b /on "*[PopCap][ExtremlymTorrents.Me].exe"') do ( Echo Installing %%~na... Echo. Start "" /wait Wscript "%Temp%\Wait.vbs" Start "" /wait "%%a" /S ) Del "%Temp%\Wait.vbs"
        after doing this all the games installed silently with no issues via fog deployment services. Thank You!!!

        1 Reply Last reply Reply Quote 0
        • Tom ElliottT
          Tom Elliott
          last edited by

          Looking at the script I can’t really tell you anything of what is, or isn’t, wrong.

          That said, do you know IF the script is actually running?

          Based on what I can see, we don’t know that at this point.

          Maybe, to your batch script, you might add some redirects to write to logs on the system? This way you can see if the script is running and where it might be failing?

          I’m not questioning your batch scripting capabilities, but I don’t know what information you do, or don’t know (so please don’t think I’m trying to belittle you or anything).

          I might do something like:

          @echo off
          echo "Starting script" >c:\PopCapInstall.log
          echo "Adding Wscript.Sleep 5000 to Wait.vbs file" >>c:\PopCapInstall.log
          Echo Wscript.Sleep 5000>"%Temp%\Wait.vbs"
          echo "Adding Wscript.Quit to Wait.vbs file" >>c:\PopCapInstall.log
          Echo WScript.Quit>>"%Temp%\Wait.vbs"
          echo "Installing Game Pack..." >>c:\PopCapInstall.log
          Echo Installing Game Pack...
          echo "" >>c:\PopCapInstall.log
          Echo.
          echo "Beginning loop" >>C:\PopCapInstall.log
          For /f "tokens=*" %%a in ('dir /b /on "*[PopCap][ExtremlymTorrents.Me].exe"') do (
          echo "Installing %%~na..." >>c:\PopCapInstall.log
          Echo Installing %%~na...
          echo "" >>c:\PopCapInstall.log
          Echo.
          Echo "Starting Wscript run">>c:\PopCapInstall.log
          Start "" /wait Wscript "%Temp%\Wait.vbs"
          Echo "Starting %%a">>c:\PopCapInstall.log
          Start "" /wait "%%a" /S
          )
          echo "Deleting Wait.vbs">>c:\PopCapInstall.log
          Del "%Temp%\Wait.vbs"
          

          Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG! Get in contact with me (chat bubble in the top right corner) if you want to join in.

          Web GUI issue? Please check apache error (debian/ubuntu: /var/log/apache2/error.log, centos/fedora/rhel: /var/log/httpd/error_log) and php-fpm log (/var/log/php*-fpm.log)

          Please support FOG if you like it: https://wiki.fogproject.org/wiki/index.php/Support_FOG

          D 1 Reply Last reply Reply Quote 0
          • J
            Joe Schmitt Senior Developer
            last edited by Joe Schmitt

            @dureal99d On a side note, your batch script is just creating a visual basic script and executing it. Why not just deploy a VBS in the snapin pack and skip the whole batch script work-a-round? The point of snapin packs is to let you bundle multiple files / scripts together.

            Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG! Get in contact with me (chat bubble in the top right corner) if you want to join in.

            D 1 Reply Last reply Reply Quote 1
            • D
              dureal99d @Tom Elliott
              last edited by

              @Tom-Elliott I know nothing of batch scripting but i’m slowly learning bit by bit. So by all means any and all help is welcome on the matter.

              1 Reply Last reply Reply Quote 0
              • D
                dureal99d
                last edited by

                @Tom-Elliott THe script for whatever reason is not executing which I find to be surprising cause when executed on windows it installs without a hitch. I assume the error code 1 is some permission issue. but I don’t know how when I have disabled the permissions on my systems?

                1 Reply Last reply Reply Quote 0
                • D
                  dureal99d @Joe Schmitt
                  last edited by

                  @Joe-Schmitt said in Batch file snapin install:

                  snapin packs is to let you bundle multiple files / scripts together.

                  I will research to see how I can convert this. I tried to save it as a vbs but nothing happens then

                  1 Reply Last reply Reply Quote 0
                  • J
                    Joe Schmitt Senior Developer
                    last edited by

                    @dureal99d you can skip the extra file altogether. I just looked at your script and you’re just using VBS to wait, which can be done in batch natively:

                    timeout /t 5 /nobreak
                    

                    Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG! Get in contact with me (chat bubble in the top right corner) if you want to join in.

                    1 Reply Last reply Reply Quote 0
                    • Wayne WorkmanW
                      Wayne Workman
                      last edited by Wayne Workman

                      said in Batch file snapin install:

                      “*[PopCap][ExtremlymTorrents.Me].exe”

                      I don’t think it knows where these are. In a batch script, the current directory is

                      %~dp0
                      

                      So maybe try this piece

                      "%~dp0*[PopCap][ExtremlymTorrents.Me].exe"
                      

                      EDIT: Fixed, ty @Joe-Schmitt

                      Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG!
                      Daily Clean Installation Results:
                      https://fogtesting.fogproject.us/
                      FOG Reporting:
                      https://fog-external-reporting-results.fogproject.us/

                      1 Reply Last reply Reply Quote 0
                      • J
                        Joe Schmitt Senior Developer
                        last edited by

                        @Wayne-Workman %~dp0 includes the trailing \

                        Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG! Get in contact with me (chat bubble in the top right corner) if you want to join in.

                        D 1 Reply Last reply Reply Quote 1
                        • D
                          dureal99d @Joe Schmitt
                          last edited by

                          @Joe-Schmitt I will try this soon and report back.

                          D 1 Reply Last reply Reply Quote 0
                          • D
                            dureal99d @dureal99d
                            last edited by

                            @Joe-Schmitt tell me if this is right.

                            @echo off
                            Echo Wscript.Sleep 5000>"%Temp%\Wait.vbs"
                            Echo WScript.Quit>>"%Temp%\Wait.vbs"
                            Echo Installing Game Pack...
                            Echo.
                            For /f "tokens=*" %%a in ('dir /b /on "%~dp0*[PopCap][ExtremlymTorrents.Me].exe" ') do (
                            Echo Installing %%~na...
                            Echo.
                            Start "" /wait Wscript "%Temp%\Wait.vbs"
                            Start "" /wait "%%a" /S
                            )
                            Del "%Temp%\Wait.vbs"```
                            Wayne WorkmanW 1 Reply Last reply Reply Quote 0
                            • Wayne WorkmanW
                              Wayne Workman @dureal99d
                              last edited by

                              @dureal99d You’ve still not gotten rid of the vbs calls.

                              Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG!
                              Daily Clean Installation Results:
                              https://fogtesting.fogproject.us/
                              FOG Reporting:
                              https://fog-external-reporting-results.fogproject.us/

                              D 1 Reply Last reply Reply Quote 0
                              • D
                                dureal99d @Wayne Workman
                                last edited by dureal99d

                                @Wayne-Workman I see. well then how about this?

                                @echo off
                                Echo Installing Game Pack...
                                Echo.
                                For /f "tokens=*" %%a in ('dir /b /on "%~dp0*[PopCap][ExtremlymTorrents.Me].exe"') do (
                                Echo Installing %%~na...
                                Echo.
                                Start "" /wait "%%a" /S
                                )
                                
                                D 1 Reply Last reply Reply Quote 0
                                • D
                                  dureal99d @dureal99d
                                  last edited by

                                  @Joe-Schmitt @Wayne-Workman @Tom-Elliott I thank you guys for the help but the original script worked just fine.

                                  I believe this one was an user error and in this case me being that user.

                                  When I made the snapin pack I messed up in how I told fog to execute the bat file inside by not telling fog that it had another folder to prior to trying to execute the bat file. as you can see from my original post I had simply _install.bat"
                                  when in reality it was popcap/_install.bat I have since then repacked the .zip file with no other folder in the way and simplified the bat file by naming it simply pop.bat all with the original coding @echo off Echo Wscript.Sleep 5000>"%Temp%\Wait.vbs" Echo WScript.Quit>>"%Temp%\Wait.vbs" Echo Installing Game Pack... Echo. For /f "tokens=*" %%a in ('dir /b /on "*[PopCap][ExtremlymTorrents.Me].exe"') do ( Echo Installing %%~na... Echo. Start "" /wait Wscript "%Temp%\Wait.vbs" Start "" /wait "%%a" /S ) Del "%Temp%\Wait.vbs"
                                  after doing this all the games installed silently with no issues via fog deployment services. Thank You!!!

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

                                  238

                                  Online

                                  12.0k

                                  Users

                                  17.3k

                                  Topics

                                  155.2k

                                  Posts
                                  Copyright © 2012-2024 FOG Project