locked
Can't install Application or script with MDT 2013 RRS feed

  • Question

  • Hi,

    I deploy computers with MDT 2013 and I'm trying to install Applications with the MDT Wizard.

    I'm creating packages with MDT in "Application" with the correct command line and others informations needed, but my Application doesn't works. When I tried to install, I have the error "Application "applicationname" can't install.Returned error code 2 (or other number)".
    When I launch the correct command line (in my application package) directly with "windows + r", my packages works.

    I start the task in a Administrator session and I start LiteTouch.vbs directly.

    For exemple :
    I want to deploy Greenshot with MDT but this application doesn't works with theses settings.

    https://imghost.io/images/2017/10/12/2017-10-1212_19_22-wds-ConnexionBureauadistance.png

    If I start the command line, directly with "Windows + R", it works ... I don't understand where is the problem.

    Same problem with a cmd script.
    I create a "Custom Task Sequence" with "Run command line" object.
    I enter : cmd.exe /c %SCRIPTROOT%\myscript.cmd and the task doesn't work.
    But, If i start this command line in "Windows + R", it's ok ...

    https://imghost.io/images/2017/10/12/2017-10-1212_19_22-wds-ConnexionBureauadistance.png

    My CustomSettings :

    https://imghost.io/images/2017/10/12/2017-10-1212_19_22-wds-ConnexionBureauadistance.png

    Thanks you in advance for your help :)

    Thursday, October 12, 2017 10:20 AM

All replies

  • Return code 2 basically means that setup failed to initialize. Could you post your command line you are using to install Greenshot and how you are configuring MDT to run the application install?

    Below is a VBS wrapper I used a while back to install Greenshot. 

    Place the setup file in the subfolder Source, adjust file name and make sure to use following command line when creating the application: cscript.exe Install-Greenshot.wsf

    <job id="Install-Greenshot">
    <script language="VBScript" src="..\..\scripts\ZTIUtility.vbs"/>
    <script language="VBScript"> 
    
    '//----------------------------------------------------------------------------
    '//
    '// This script is provided "AS IS" with no warranties, confers no rights and 
    '// is not supported by the authors or Deployment Artist. 
    '//
    '//----------------------------------------------------------------------------
    
    '//----------------------------------------------------------------------------
    '// Global constant and variable declarations
    '//---------------------------------------------------------------------------- 
    
    Option Explicit 
    Dim iRetVal 
    
    '//----------------------------------------------------------------------------
    '// End declarations
    '//---------------------------------------------------------------------------- 
    
    '//----------------------------------------------------------------------------
    '// Main routine
    '//---------------------------------------------------------------------------- 
    
    On Error Resume Next
    iRetVal = ZTIProcess
    ProcessResults iRetVal
    On Error Goto 0 
    
    '//---------------------------------------------------------------------------
    '//
    '// Function: ZTIProcess()
    '//
    '// Input: None
    '// 
    '// Return: Success - 0
    '// Failure - non-zero
    '//
    '// Purpose: Perform main ZTI processing
    '// 
    '//---------------------------------------------------------------------------
    
    Function ZTIProcess() 
    
    	Dim sSetupFile
    	Dim sArguments
    
    	sSetupFile = oUtility.ScriptDir & "\Source\Greenshot-INSTALLER-1.1.9.13.exe"
    	sArguments = "/verysilent /Language de"
    
    	oLogging.CreateEntry oUtility.ScriptName & ": Starting installation", LogTypeInfo
    
    	If not oFSO.FileExists(sSetupFile) then
    		oLogging.CreateEntry oUtility.ScriptName & ": " & sSetupFile & " was not found, unable to install", LogTypeError
    		ZTIProcess = Failure
    		Exit Function
    	End if
    
    	iRetVal = oUtility.RunWithHeartbeat("""" & sSetupFile & """ " & sArguments)
    	
    	if (iRetVal = 0) or (iRetVal = 3010) then
    		ZTIProcess = Success 
    	Else 
    		ZTIProcess = Failure
    	End If
    	
    	oLogging.CreateEntry oUtility.ScriptName & ": Return code from command = " & iRetVal, LogTypeInfo
    	oLogging.CreateEntry oUtility.ScriptName & ": Finished installation", LogTypeInfo
    	
    End Function 
    
    </script>
    </job>


    Cheers,
    Anton

    Vacuum Breather Blog | Wing Commander Saga | Twitter

    Note: Posts are provided "AS IS" without warranty of any kind. If posts are helpful please don't forget to rate them as "Helpful" or as "Answer".

    • Proposed as answer by JiteshKumar Tuesday, October 17, 2017 4:28 AM
    Thursday, October 12, 2017 7:46 PM
  • Hi,

    In my "Application", I created an Application package with Greenshot Setup and I add this command line :
    Quiet Install command : Greenshot-installer-1.2.10.6-RELEASE /VERYSILENT
    Working directory : .\Applications\Greenshot 1.2.10

    Is it recommand to use .vbs scripts to install applications ?

    Friday, October 13, 2017 6:11 AM
  • There is no general guidance, it is just something that works for me and I've been using this approach for years.

    How are you initiating installation from your TS? MandatoryApplication001={GUID} in your CS.ini, a separate install application step in TS?


    Cheers,
    Anton

    Vacuum Breather Blog | Wing Commander Saga | Twitter

    Note: Posts are provided "AS IS" without warranty of any kind. If posts are helpful please don't forget to rate them as "Helpful" or as "Answer".

    Friday, October 13, 2017 7:09 AM