How do I get this Post Install Task to work?
I have looked deep for a solution but I have yet to find an answer.
Following this blog post (https://www.itninja.com/blog/view/installing-microsfot-office2019-project-2019-or-visio-2019-via-sda-or-sma) I attempted to get Microsoft office pro plus 2019 installed as a post install task. Using the Clientdrop feature, I've pointed it to a zip file of the setup.exe, the configuration XML file, the downloaded office files, and a bat file with the following code:
@echo off
pushd "%~dp0"
setup.exe /configure office2019.xml
popd
exit /b 0
Note: I have just tried it with setup.exe /configure office2019.xml in the batch file or just in the full command line with no luck.
When I go about testing the script to make sure it works properly, I run into the following:
You'll see that it fails at that particular task. When I open up Command Prompt and search for that task ID, it does find it listed in the dir but when I open that particular folder, there are no files in that directory.
I'm at a loss why it is not putting the items into that folder so that it can install them.
Any help would be appreciated.
Answers (2)
Hi BreevesMSCC, Depending first on which SDA version you have. If its the last actual 1 there is a bug and Quest provide a tips to adress it.
First you have to extract the Office ISO file on your sda >> \\SDA IP@\petemp\Directory name where you want to copy all files.
Then in the update directory, copy your msp and xml file that you have done with setup admin.
On your SDA intermediate task create a bat task which will contains something similar to this:
--------------------------------------------------------------------------------
mkdir Office2016Standard
cls
xcopy /E /H /Y "T:\office2016" "c:\Office2016Standard\"
cls
exit
--------------------------------------------------------------------------------
Add a file called for example install.bat in your office directory on the sda petemp which will contains the following line:
----------------------------------------------------
C:\Office2016Standard\setup.exe /adminfile C:\Office2016Standard\updates\CustominstallINOLYA.MSP
----------------------------------------------------
Change MSP name by the one you create. Also important point is the name of the directory you have to create on the pc should by exactly the same of the directory from where you have launch your setup.exe /admin otherwise it's won't work.
This will copy all file to the pc where you want to deploy your office.
Next step in post-installation task, you have to create 2 different task.
The first 1 in bat to launch the installation of your office and will contain the following line:
----------------------------------------------------
c:\Office2016Standard\install.bat
----------------------------------------------------
The last step is to create a new bat script to cleanup your computer (This task is not mandatory). In this task set the following:
----------------------------------------------------
c:\Office2016Standard\install.bat
EXIT
----------------------------------------------------
Now on your deployment task just add in the intermediate script the new bat script task and in post-installation the 2 new script and start your deployment this should work like for me.
From the SMA server, as you can't now how before in which directory your application will be copy, you have to use a vbsscript to found it's location. The vbsscript I use is as follow:
-------------------------------------------------------------------------------------------------------------------------------------------------
' Le VBS permet de remplacer le chemin des sources d'office dans le fichier configuration.xml
' Le fichier est mis dans un tableau, le tableau est ensuite reinjecté dans le XML
Set Fso = CreateObject( "Scripting.FileSystemObject" )
Set shell = CreateObject("WScript.Shell")
Dim Tab
Redim tab(0)
on error resume next
' Ajout du fichier XML dans un tableau
If Fso.FileExists(GetPath & "mediafeaturepack.txt") Then
set inf= Fso.OpenTextFile(GetPath & "mediafeaturepack.txt")
While inf.AtEndOfStream <> True
Ligne = inf.readline
' Chaque ligne du tableau correspond a une ligne du fichier XML
Tab(Ubound(tab)) = Ligne
Redim preserve Tab(Ubound(tab)+1)
Wend
End If
inf.close
' Ecrasement du fichier XML pour le remplacer par les lignes du tableau
Set infW = Fso.CreateTextFile(GetPath & "mediafeaturepack.txt",True)
For i=0 To (Ubound(Tab) -1)
' Remplacement de la ligne contenant le chemin des sources Office pour le chemin courant
If Instr(Tab(i),"<Add SourcePath=") <> 0 Then
Tab(i) = " <Add SourcePath=" & chr(34) & Left(Getpath,Len(Getpath)-1) & chr(34) & " OfficeClientEdition="& chr(34) & "32" & chr(34) & " >"
End If
CodeRetour = infw.writeLine(Tab(i))
Next
infW.close
Function GetPath()
Dim path
Deftpath = WScript.ScriptFullName
GetPath = Left(Deftpath, InStrRev(Deftpath, "\"))
End Function
-------------------------------------------------------------------------------------------------------------------------------------------------
In the script you will have 2 line as per below
set inf= Fso.OpenTextFile(GetPath & "mediafeaturepack.txt")
change the value "mediafeaturepack.txt" by a name of an empty txt file you will create and where your setup file will be
copy this vbsscript in the same directory where the office setup.exe file is
Then also in the same directory, create an "install.bat" file which will contains the following:
-----------------------------------------------------------------------------------------------------------------
c:\windows\system32\cscript.exe //b //e:vbscript "%~dp0ChangePathXML.vbs"
"%~dp0setup.exe" /adminfile "%~dp0\updates\Office2016StandardInolya.MSP"
-----------------------------------------------------------------------------------------------------------------
Update the msp file name "Office2016StandardInolya.MSP" with your custom MSP file name
Create a zip file with all file which mean Office file + in update directory your msp and xml file + the .txt, the .bat file and vbsscript in the office directory
Then to finish, create on your SMA a script on which 1 you add the zip file and you launch install.bat