7 Replies Latest reply on Sep 8, 2009 8:16 PM by shafiqulhaque

    Run from source using preferred servers and batch package

    Apprentice

      Hello,

       

      as our landesk-deployment comes to its final phase i'm currently trying to build a package with a huge amount of sourcefiles (oracle client).

       

      Because of this i tried to use a method which uses "run from source" instead of "download from source" (which works fine!). We're using a preferred server on each site, which can be accessed via UNC only. (e.g. \\preferred_package_server\package_share\package_folder\*)

       

      The batchfile (in package_folder) normally looks (when downloading from source) like this:

       

      cscript some_vbscript.vbs installer.exe /some_switches

      some_other_stuff ...

       

       

      When using "download from source" everything works fine. The package_folder is downloaded via peer or preferred server.

       

      When using "run from source" the batch (started from the core) ends up in errors because the batch looks locally for files ...

       

      It tried another batch, which looks like this:

       

       

      cscript \\%coreserver%\some_vbscript.vbs \\%coreserver%\installer.exe /some_switches

       

      This batch runs without errors but the installation is done completely from our core. Because of bandwidth problems this is not a solution. The severname-substitution (coreservername replaced by preferredservername) doesn't work here?

       

       

      What I need is something like this in my batchfiles:

       

      cscript \\%clients_preferred_server%\some_vbscript.vbs \\%clients_preferred_server%\installer.exe /some_switches

       

       

      Is that possible or do i have to parse the clients preferredserver.dat to get a pps-variable?

       

       

      Thanks for your help!

       

      Greets from germany,

      Dirk

        • 1. Re: Run from source using preferred servers and batch package
          zman Master

          I have requested that LANDesk expose the preferred server name so that it can be used programmatically, maybe this will happen in 9.0.  So you have these options (plus more that others will offer):

           

          1. Use your VB script to grab the preferred server and use it as a variable in your script. Grab the name from C:\Program Files\LANDesk\LDClient\sdmcache\preferredservers.<CORE NAME>.dat
          2. In your vbscript programatically find a way to identify the server name the script is ran from. In Autoit it would be @ScriptDir vbscript will take a lot more lines ;-).
          3. Use a DNS alias or DFS so that you have a consistent/predictable unc path (e.g., \\packages\.....)
          4. Rather than run from source you can zip up the source so that you have one install file. sdclient has some issues (slowness) when a lot of smaller files are in a package. THis way distribute the one file, expand, then run locally. This will help with peer downloads, and targeted Multicast if needed.

           

          Hopefully this gives you some ideas.

          1 of 1 people found this helpful
          • 2. Re: Run from source using preferred servers and batch package
            Apprentice

            thanks for your fast reply, zman!

            your first idea was exactly the one, which i thought about this morning. just added another sub to my vbs ... works pretty fine.

             

            if there's another - somewhat "official" - way to do this ... please tell me ;-)

             

            thanks for your help!

             

            dirk

            • 3. Re: Run from source using preferred servers and batch package
              zman Master

              LOL - If it works it is official.

              • 4. Re: Run from source using preferred servers and batch package
                Rookie

                Hello Dirk,

                 

                Would you be able to share the portion of your VBS code that extracts the Preferred server info?

                 

                For similar reasons I am also trying to use Batch package and Run from source method to install Office 2007 (with many MUI) and other similar software. I have not spent any time writing a VBS or an AutoIt script to extract the Preferred Server value, but trying to use batch run-time variables "%~d0" & "%~dp0".

                 

                set currdrv=%~d0
                set currdir=%~dp0
                %currdir%PackageShare\PackageDir\Setup.exe /adminfile %currdir%PackageShare\PackageDir\Updates\Office2007Std.MSP /config %currdir%PackageShare\PackageDir\Standard.WW\config.xml

                 

                Although the batch works outside of LDMS, it is not working with Run from source method.

                 

                Have anybody tried this successfully?

                 

                Thanks,

                Shafiqul

                • 5. Re: Run from source using preferred servers and batch package
                  Apprentice

                  Hi Shafiqul,

                   

                  no problem. My vbs ist called "pps_setup.vbs" and it is called from the batch this way:

                   

                  cscript \\%coreserver%\packageshare\packagedir\install\pps_setup.vbs \\LDPPS\packageshare\packagedir\install\setup.exe

                   

                  The LDPPS-String is replaced by pps_setup.vbs. Here are the main parts of the script (it does a lot of other stuff - like error checking, generating some flagfiles, etc etc)

                   

                  <...>

                  pps_file = programfiles & "\LANDesk\LDClient\sdmcache\preferredservers." & coreserver & ".dat"

                  wscript.echo "opening " & pps_file

                  Set pps = fso.opentextfile(pps_file, ForReading)
                       pps_line = pps.readline
                  pps.close
                  pps_line_arr = split(pps_line, "?")
                  ppserver = pps_line_arr(1)
                  wscript.echo "preferred package server: " & ppserver

                  <...>

                   

                  after extracting the package server, the commandline will be executed:

                   

                  <...>

                  arg_string = trim(arg_string)
                  arg_string = replace(arg_string, "#", chr(34))
                  arg_string = replace(arg_string, "LDPPS", ppserver)

                  wscript.echo "now executing: " & arg_string

                  return = wshShell.run(arg_string, 1, true)

                  wscript.echo "finished with errorlevel: " & return

                  <...>

                  • 7. Re: Run from source using preferred servers and batch package
                    Rookie

                    Hello Dirk,

                     

                    Thank you so much for sharing the VBS code. This may be helpful. Also, you may want to look into Jan Buelen's Preferred Server Tools, as Zman pointed out and posted in http://community.landesk.com/support/thread/6479. I reviewd the solution and it looks promising.

                     

                    Thank you, Zman!

                     

                    Regards,

                    Shafiqul