locked
Passing a parameter to an Applciation install that requires a full path. RRS feed

  • Question

  • Hi All,

    I have a few applications that I'm trying to setup that require the full path to a file passed as a parameter in order to install. This does not need to be a local path and the mapped share variable will work (i.e. %DEPLOYROOT%\Applications\..."), but I just wondered if the was a way of getting MDT to insert to correct path for me?

    As you create an Application, so MDT will copy the files to the Deployment Share, and create a specific folder to house the install files. I can then navigate to that folder and grab the necessary path from the %DEPLOYROOT%.

    For instance, deploying some application files  (not driver) that use and INF to install, I have.

    infdefaultinstall "%DEPLOYROOT%\Applications\Path to App\Install.inf"

    And for some InstallShield Apps, I have created an Answer file that need to be reference, such that:

    Setup.exe /s /f1"%DEPLOYROOT%\Applications\Path to App\Setup.iss"

    Is there a way of getting MDT to do this automatically, to even a better way of setting these apps up?


    Chris

    Wednesday, August 12, 2015 12:57 PM

All replies

  • I do that for pretty much everything I install because I use VBscript wrappers.

    So in this script I install firefox and copy over configuration files all while just using variables. One of the most important parts of the script is: <script language="VBScript" src="..\..\scripts\ZTIUtility.vbs"/>

    Because that references the ZTIUtility file where the MDT variables are set, so I don't need to recreate them in my script.

    <job id="Install-MozillaFirefox">
    <script language="VBScript" src="..\..\scripts\ZTIUtility.vbs"/>
    <script language="VBScript"> 
    
    '//----------------------------------------------------------------------------
    '// Purpose: Used to install Flash Player
    '// Usage: cscript Install-MozillaFirefox.wsf [/debug:true]
    '// Version: 1.0 - September 29, 2014
    '// Version: 1.1 - February 6, 2015 - Corrected architecture detection
    '//
    '//
    '//----------------------------------------------------------------------------
    
    '//----------------------------------------------------------------------------
    '// 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() 
    
    
    	oLogging.CreateEntry "Install-MozillaFirefox: Starting Mozilla Firefox installation", LogTypeInfo	
    
    	' Disable Zone Checks
    	oEnv("SEE_MASK_NOZONECHECKS") = 1 
    
    	
    	' Install Mozilla Firefox
    	iRetVal = oUtility.RunWithHeartbeat(oUtility.ScriptDir & "\Installer\Setup.exe -ms")
    	
    	if (iRetVal = 0) or (iRetVal = 3010) then
    		ZTIProcess = Success 
    	Else 
    		ZTIProcess = Failure
    		oLogging.CreateEntry "Install-MozillaFirefox: Error installing Application Plugin. Check the log " & oUtility.LocalRootPath & "\SMSOSD\OSDLOGS\Install-MozillaFirefox-Plugin-App.log", LogTypeWarning
    	End If
    
    	
    	' Configure Mozilla Firefox
    	If oEnvironment.Item("Architecture") = "X86"  then 
    		oLogging.CreateEntry oUtility.ScriptName & ": Configuring for 32bit OS", LogTypeInfo
    		oFSO.CopyFile oUtility.ScriptDir & "\Installer\override.ini", oENV("ProgramFiles") & "\Mozilla Firefox\", True
    		oFSO.CopyFile oUtility.ScriptDir & "\Installer\mozilla.cfg", oENV("ProgramFiles") & "\Mozilla Firefox\", True
    		oFSO.CopyFile oUtility.ScriptDir & "\Installer\local-settings.js", oENV("ProgramFiles") & "\Mozilla Firefox\Defaults\Pref\", True
    
    	Else
    
    		oLogging.CreateEntry oUtility.ScriptName & ": Configuring for 64bit OS", LogTypeInfo
    		oFSO.CopyFile oUtility.ScriptDir & "\Installer\override.ini", oENV("ProgramFiles(x86)") & "\Mozilla Firefox\", True
    		oFSO.CopyFile oUtility.ScriptDir & "\Installer\mozilla.cfg", oENV("ProgramFiles(x86)") & "\Mozilla Firefox\", True
    		oFSO.CopyFile oUtility.ScriptDir & "\Installer\local-settings.js", oENV("ProgramFiles(x86)") & "\Mozilla Firefox\Defaults\Pref\", True
    
    	End If
    
    	' Enable Zone Checks
    	oEnv.Remove("SEE_MASK_NOZONECHECKS")
    
    	oLogging.CreateEntry "Install-MozillaFirefox: Return code from command = " & iRetVal, LogTypeInfo
    	oLogging.CreateEntry "Install-MozillaFirefox: Finished Mozilla Firefox installation", LogTypeInfo	
    	
    End Function 
    
    </script>
    </job>
    The directory structure would look like this:


    If this post is helpful please vote it as Helpful or click Mark for answer.


    • Edited by Dan_Vega Wednesday, August 12, 2015 1:57 PM added another picture
    Wednesday, August 12, 2015 1:42 PM
  • Oh another benefit to this method is that you can create log files for each app you install which can make troubleshooting easier.


    If this post is helpful please vote it as Helpful or click Mark for answer.

    Wednesday, August 12, 2015 1:43 PM
  • You can create a wrapper, otherwise if your working directory is set to .\Applications\Path to App\, then your command would be Setup.exe /s /f1".\Setup.iss" or "setup.iss".  You're already working out of that directory specified so you don't need to tell it in the command line to go there.
    Wednesday, August 12, 2015 1:49 PM
  • You can create a wrapper, otherwise if your working directory is set to \Applications\Path to App\, then your command would be Setup.exe /s /f1".\Setup.iss" or "setup.iss". You're already working out of that directory specified so you don't need to tell it in the command line to go there.
    Yes, you would think so! This often doesn't work, even on local installs.

    Chris


    • Edited by Swinster Wednesday, August 12, 2015 2:00 PM
    Wednesday, August 12, 2015 1:59 PM
  • I do that for pretty much everything I install because I use VBscript wrappers.

    Loverly. This is a whole new world to me, but in fact I came across this very solution recently when looking at a Windows 10 MDT 2013 Update 1 Preview walkthrough. I just didn't apply that logic to everything.

    Many thanks


    Chris

    Wednesday, August 12, 2015 2:11 PM
  • Then there has to be a pathing issue somewhere.  Usually if you look in the SMSTS.log file, you can see the exact command line being passed with the expanded .\ path.  I would validate what's being called, and that the path being called in SMSTS matches where the config files located.

    Wednesday, August 12, 2015 5:24 PM
  • You can create a wrapper, otherwise if your working directory is set to \Applications\Path to App\, then your command would be Setup.exe /s /f1".\Setup.iss" or "setup.iss". You're already working out of that directory specified so you don't need to tell it in the command line to go there.

    Yes, you would think so! This often doesn't work, even on local installs.

    Chris



    It is a bug in installshield installs.  Depending on the version that was used to create the installer exe.  You pretty much have to test and test some more.  Also it will often be different for media and network...

    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.

    Wednesday, August 12, 2015 5:56 PM