locked
Application install failures (Unable to set working directory) RRS feed

  • Question

  • Hi all

    I'm working on creating our Win10 (1607 LTSB) reference image.  I'm using MDT (8443).

    The OS applies fine (along with the latest servicing stack and CU).

    The task sequence then kicks off some 'core component' tasks, such as Enable .Net 3.5 feature, install all the VC++ redistributables, and install Silverlight.

    The .Net feature is enabled fine, and the .wsf that installs all the VC++ runs without issues.  We then get to the Silverlight install and I get a failure.  The BDD log shows:

    ################	ZTIApplications	09/11/2017 08:39:24	0 (0x0000)
    Entry: {4eff0765-9801-4641-a7cf-dd6860908722}	ZTIApplications	09/11/2017 08:39:24	0 (0x0000)
    Name:  Microsoft Silverlight x64 5.1.50907.0	ZTIApplications	09/11/2017 08:39:24	0 (0x0000)
    ################	ZTIApplications	09/11/2017 08:39:24	0 (0x0000)
    Using a local or mapped drive, no connection is required.	ZTIApplications	09/11/2017 08:39:24	0 (0x0000)
    Change directory: Z:\Applications\Microsoft Silverlight x64 5.1.50907.0	ZTIApplications	09/11/2017 08:39:24	0 (0x0000)
    WARNING - unable to set working directory:  (-2147024893)	ZTIApplications	09/11/2017 08:39:24	0 (0x0000)
    Run Command: \\MDTServer\DeploymentShare$\Tools\X64\bddrun\DeploymentShare$\Tools\X64\bddrun.exe install.cmd	ZTIApplications	09/11/2017 08:39:24	0 (0x0000)
    ZTI installing application 	ZTIApplications	09/11/2017 08:39:24	0 (0x0000)
    Event 41031 sent: ZTI installing application 	ZTIApplications	09/11/2017 08:39:24	0 (0x0000)
    About to run command: \\MDTServer\DeploymentShare$\Tools\X64\bddrun.exe install.cmd	ZTIApplications	09/11/2017 08:39:24	0 (0x0000)
    Command has been started (process ID 1852)	ZTIApplications	09/11/2017 08:39:24	0 (0x0000)
    Return code from command = 2	ZTIApplications	09/11/2017 08:39:25	0 (0x0000)
    Application Microsoft Silverlight x64 5.1.50907.0 returned an unexpected return code: 2	ZTIApplications	09/11/2017 08:39:25	0 (0x0000)
    Event 41034 sent: Application Microsoft Silverlight x64 5.1.50907.0 returned an unexpected return code: 2	ZTIApplications	09/11/2017 08:39:25	0 (0x0000)
    

    I'm seeing this for other applications later in the TS too.  Not sure if relevant but all are installing using .bat or .cmd files.

    These applications do not present any issues when we create our Win7 reference .. it's just happening on Win10.

    Any advice on what could be going on here would be gratefully received.

    Thanks in advance.

    Thursday, November 9, 2017 9:12 AM

Answers

  • Without seeing your install.cmd script and the way you configure applications, there is little I can gather from the log snippet posted above.

    Personally I use Johan's VBS wrapper to install applications (see below for an example).

    Assume following scenario: you place source files in the subfolder Source. You call the script in the MDT workbench using cscript.exe Install-MicrosoftSilverlight5x64.wsf

    <job id="Install-MicrosoftSilverlight5x64">
    <script language="VBScript" src="..\..\scripts\ZTIUtility.vbs"/>
    <script language="VBScript"> 
    
    '//----------------------------------------------------------------------------
    '// Purpose: Used to install Microsoft Silverlight 5.0 x64
    '// Usage: cscript Install-MicrosoftSilverlight5x64.wsf [/debug:true]
    '// Version: 1.2 - August 8, 2012 - Johan Arwidmark
    '//
    '// 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\Silverlight_x64.exe"
    	sArguments = "/q"
    
    	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".

    • Marked as answer by ep1971 Friday, November 10, 2017 1:54 PM
    Thursday, November 9, 2017 12:06 PM

All replies

  • Without seeing your install.cmd script and the way you configure applications, there is little I can gather from the log snippet posted above.

    Personally I use Johan's VBS wrapper to install applications (see below for an example).

    Assume following scenario: you place source files in the subfolder Source. You call the script in the MDT workbench using cscript.exe Install-MicrosoftSilverlight5x64.wsf

    <job id="Install-MicrosoftSilverlight5x64">
    <script language="VBScript" src="..\..\scripts\ZTIUtility.vbs"/>
    <script language="VBScript"> 
    
    '//----------------------------------------------------------------------------
    '// Purpose: Used to install Microsoft Silverlight 5.0 x64
    '// Usage: cscript Install-MicrosoftSilverlight5x64.wsf [/debug:true]
    '// Version: 1.2 - August 8, 2012 - Johan Arwidmark
    '//
    '// 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\Silverlight_x64.exe"
    	sArguments = "/q"
    
    	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".

    • Marked as answer by ep1971 Friday, November 10, 2017 1:54 PM
    Thursday, November 9, 2017 12:06 PM
  • Hi

    Thanks for your reply.

    Here's an example of the Silverlight install.cmd:

    @echo off
    cls
    TITLE Installing Silverlight 5
    echo.
    echo Installing Silverlight 5 ...
    start /wait Silverlight_x64.exe /q /noupdate
    REM Ensure updates ARE disabled
    reg add HKLM\Software\Microsoft\Silverlight /v UpdateMode /t REG_DWORD /d 0x00000002 /f
    reg add HKLM\Software\Microsoft\Silverlight /v DRMEnabled /t REG_DWORD /d 0x00000001 /f
    reg add HKLM\Software\Microsoft\Silverlight /v AllowWebcam /t REG_DWORD /d 0x00000000 /f
    REM Remove start menu shortcut
    rmdir /s /q "%ALLUSERSPROFILE%\Microsoft\Windows\Start Menu\Programs\Microsoft Silverlight"

    Weirdly .. Silverlight has now started working after I notched it up two steps in the TS.  It was below the VC++ step, but now installs fine in its current position.  I have no idea why.

    However, another app install that takes place just after the 2nd restart on the pic above is still failing.

    I can't post the contents, but it's basically an install.cmd that long these lines:

    @echo off
    cls
    TITLE Installing XXXXX Certificates
    echo.
    certutil -addstore Root xxx.crt
    certutil -addstore Root xxx.crl
    
    etc ...

    As I said in my previous post, all these files have worked fine previously for the Win7 reference image.

    I've just been monitoring my Win10 reference image creation and, after the certificate step failed I quickly opened up the Deployment Share and ran the batch file, and it worked.  It's just not working as a TS step (not even trying to run the batch file).




    • Edited by ep1971 Thursday, November 9, 2017 2:59 PM
    Thursday, November 9, 2017 1:02 PM
  • Rather than messing around trying to get .cmd files to work (even though they used to) I will just use Johann's VB script.  Works perfectly!

    Thanks for your help Anton.

    Friday, November 10, 2017 1:54 PM