/build/static/layout/Breadcrumb_cap_w.png

Software deployment - batch script return "installation failed", or find another method for installing

With AutoDesk software installations, the best way I've found to install them is to launch the setup.exe that's generated when creating the deployment from within the AutoDesk installer.  These are standard network installers.  The line I use in the batch script looks something like this:

start /wait \\domain.com\Deployments\AutoCAD_2015\Img\Setup.exe /Q /I \\domain.com\Deployments\AutoCAD_2015\Img\AutoCAD_2015.ini /language en-us

The issue is that I've got 4 different versions of AutoCAD set to install from the K1000, and even though they each have a different order number set, they seem to start on top of each other.  The odd behavior this is causing is that this install script runs, the AutoDesk installer sees that another AutoDesk installer is running and fails, but that happens on the setup.exe level.  The K1000 marks the software as "installed" and doesn't retry until the computer is inventoried 4 hours later or manual intervention is involved.

I'm pretty sure that the "start /wait" works for a bit to hold the installation process open and prevents the K1000 agent from telling the K1000 appliance that the software has finished installing successfully.... That is, until the setup.exe spawns the other installers that are involved.  After that happens it appears that the "start /wait" stops waiting and the K1000 tries moving onto the next software, which happens to be the next AutoDesk application.

I'd like do one of two things here:
1. To make my batch script first check and see if the setup.exe is still running, and if it does send a message back to the kace that it's failed and needs to be retried.
2. To find another method for calling that setup.exe and waiting until it's truly 100% finished before telling the K1000 to proceed with the next installation.



From the AutoCAD install log that shows why the second/third/fourth installations are failing:
2016/8/22:11:54:35 SYSTEM TEST-VM CommandLine /Q /I \\domain.com\Deployments\AutoCAD_2015\Img\AutoCAD_2015.ini /language en-us
2016/8/22:11:54:35 SYSTEM TEST-VM Another Autodesk install/update is now occurring on this computer.  Please wait for that to complete and then click Retry.
2016/8/22:11:54:35 SYSTEM TEST-VM === Setup ended ===

0 Comments   [ + ] Show comments

Answers (4)

Posted by: anonymous_9363 8 years ago
Red Belt
1
>  I see MST's for some of the MSI's, but not all of them. Is this a problem?
Not in the least. Itjust means I was happy to allow defaults for that sub-product.

>custom support paths
I don't know what these are - I'm the packager not the user! :-) Your best bet is to find out where that configuration is recorded (i.e. in the registry, in a config XML/INI/whatever) and then add that to the appropriate MST or just build your own MSI/script to add the configuration.
Posted by: dcookBE 8 years ago
Senior White Belt
1
instead of using batch files use powershell you will have the power to run a program and wait for return and can detect if a program is running 

Get-Process -Name 'calc' will return with out errors if calculator is running this can be used to see a process is running 
will start program and wait for it to finish before doing the next step
Start-Process myprogram.exe -NoNewWindow -Wait
Posted by: anonymous_9363 8 years ago
Red Belt
0
> the best way I've found to install them is to launch the setup.exe
Nope. Find the installer batch file that Autodesk give you. That performs an installation using the MSIs, for which you should create MSTs: installing using the defaults means you get, for example, automatic updates, which you *really* don't want.

Comments:
  • Are you referring to the SCCM text file that comes with it that lists individual packages to install? Directly from that file it says "The following command line will install all components of the deployment. This is the recommended method of advertising Autodesk deployments using SMS or SCCM" and then lists the line I use. Then below that it says "These command lines are recommended only when special conditions or policies prevent use of the single command line method above." lists all of the individual packages. I guess what you're saying is that with the Kace, a "special condition" exists to which the setup.exe doesn't work well?


    I'll give this a shot and see if it fixes these deployments all attempting to install on top of each other! - matt1738 8 years ago
Posted by: anonymous_9363 8 years ago
Red Belt
0

>I guess what you're saying is
Not really, no. What I'm saying is, creating transforms against the vendor's MSIs allows you to fine tune the installation and log each part of the installation separately.

Here's a heavily edited version of an Autodesk command file that I use for NavisWorks Freedom. It looks complicated but it's pretty straightforward, really. Basically, you pass a set of up to 4 parameters to the DoInstall "function": Path_to_and_Name_of_MSI, Path_to_and_name_of_MST, Path_to_and_Name_of_Logfile and optionally, Path_to_and_name_of_secondary_transform.


set logfilepath=%windir%\TEMP

:// MSXML 6.0 Parser
:// This product is installed by a separate process

:// Microsoft Visual C++ 2008 SP1 Redistributable (x64)
:// This product is installed by a separate process

:// Microsoft Visual C++ 2010 SP1 Redistributable (x64)
:// This product is installed by a separate process

:// Microsoft Visual C++ 2012 Redistributable (x86)
:// This product is installed by a separate process

:// Microsoft Visual C++ 2012 Redistributable (x64)
:// This product is installed by a separate process

:// Universal C Runtime (KB3118401)
:// This product is installed by a separate process

:// Microsoft Visual C++ 2015 Redistributable (x86)
:// This product is installed by a separate process

:// Microsoft Visual C++ 2015 Redistributable (x64)
:// This product is installed by a separate process

:// DirectX® Runtime
:// This product is installed by a separate process

:// .NET Framework Runtime 4.6
:// This product is installed by a separate process

:// .NET Framework Runtime 4.6 Language pack
:// This product is installed by a separate process

:// Below, the log file names "proper" are prefixed with a sequence number,
:// simply so that they appear in the log file folder in the order in which they were installed

:// Autodesk Material Library 2017
call :DoInstall Img\Content\ADSKMaterials\2017\CM\MaterialLibrary2017, Img\Content\ADSKMaterials\2017\CM\Autodesk_MaterialLibrary2017_15.11.3.0_x64_1.00_DE, 01Autodesk_MaterialLibrary2017_15.11.3.0_x64_1.00_DE

:// Autodesk Material Library Base Resolution Image Library 2017
call :DoInstall Img\Content\ADSKMaterials\2017\ILB\BaseImageLibrary2017, Img\Content\ADSKMaterials\2017\ILB\Autodesk_BaseImageLibrary2017_15.11.3.0_x64_1.00_DE, 02Autodesk_BaseImageLibrary2017_15.11.3.0_x64_1.00_DE

:// Autodesk Advanced Material Library 2017
call :DoInstall Img\Content\ADSKMaterials\2017\CM_Advanced\AdvancedMaterialLibrary2017, Img\Content\ADSKMaterials\2017\CM_Advanced\Autodesk_AdvancedMaterialLibrary2017_15.11.3.0_x64_1.00_DE, 03Autodesk_AdvancedMaterialLibrary2017_15.11.3.0_x64_1.00_DE

:// Autodesk Advanced Material Library Image Library 2017
call :DoInstall Img\Content\ADSKMaterials\2017\AIL\AdvancedImageLibrary2017, Img\Content\ADSKMaterials\2017\AIL\Autodesk_AdvancedImageLibrary2017_15.11.3.0_x64_1.00_DE, 04Autodesk_AdvancedImageLibrary2017_15.11.3.0_x64_1.00_DE

:// Autodesk Navisworks Freedom 2017
call :DoInstall Img\x64\NAVFREE\freedom, Img\x64\NAVFREE\Autodesk_NavisworksFreedom2017_14.0.1298.75_x64_1.00_DE, 05Autodesk_NavisworksFreedom2017_14.0.1298.75_x64_1.00_DE, Img\x64\de-de\NAVFREE\freedom

:// Autodesk Navisworks Freedom 2017 - Deutsch (German) Language Pack
call :DoInstall Img\x64\de-de\NAVFREE\NAVFREE_LP, Img\x64\NAVFREE\Autodesk_NavisworksFreedom2017_14.0.1298.75_x64_1.00_DE, 06Autodesk_NavisWorksFreedom2017_GermanLanguagePack_14.0.1298.75_x64_1.00_DE

if %errorlevel%==0 goto End
echo Installation failed - error %errorlevel% occured

:End
exit /b %errorlevel%

:// Functions
://
 :// DoInstall
 :DoInstall
  setlocal
  set MSI=%~1
  set MST=%~2
  set logfilename=%~3
  set MST2=%~4

  set logfile=%LOGFILEPATH%\Install_%LOGFILENAME%.LOG

  call :StrLen MST2 StringLength
  if %StringLength%==0 goto SingleTransform
  
  msiexec /i "%~dp0%MSI%.MSI" TRANSFORMS="%~dp0%MST%.MST;%~dp0%MST2%.MST" /qn /l*v "%LOGFILE%"
  goto TestErrorLevel
  
  :SingleTransform
  msiexec /i "%~dp0%MSI%.MSI" TRANSFORMS="%~dp0%MST%.MST" /qn /l*v "%LOGFILE%"

  :TestErrorLevel
  if %errorlevel%==0 goto function_Success

  :function_Failed
   echo Installation failed - error %errorlevel% occured
   goto function_Done

  :function_Success
   echo Installation was successful

  :function_Done
  endlocal

  exit /b
 :// DoInstall end

 :// StrLen
 :StrLen <stringVar> <resultVar>
  setlocal EnableDelayedExpansion
  set "s=#!%~1!"
  set "len=0"
  for %%N in (4096 2048 1024 512 256 128 64 32 16 8 4 2 1) do (
    if "!s:~%%N,1!" neq "" (
      set /a "len+=%%N"
      set "s=!s:~%%N!"
    )
  )
  endlocal&if "%~2" neq "" (set %~2=%len%) else echo %len%
 exit /b
 :// StrLen end
://
:// Functions end

:Done


Comments:
  • Interesting! I think I follow this script fairly well. One thing I don't see here... I see MST's for some of the MSI's, but not all of them. Is this a problem? - matt1738 8 years ago
  • We set custom support paths in this deployment. It doesn't appear that these got set when I installed this way. Do you know if that should have been installed, or if maybe I just missed something? - matt1738 8 years ago

Don't be a Stranger!

Sign up today to participate, stay informed, earn points and establish a reputation for yourself!

Sign up! or login

Share

 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ