Error 60002 in Office 365 installation

Here is my code

[CmdletBinding()]
Param (
[Parameter(Mandatory=$false)]
[ValidateSet(‘Install’,‘Uninstall’)]
[string]$DeploymentType = ‘Install’,
[Parameter(Mandatory=$false)]
[ValidateSet(‘Interactive’,‘Silent’,‘NonInteractive’)]
[string]$DeployMode = ‘Interactive’,
[Parameter(Mandatory=$false)]
[switch]$AllowRebootPassThru = $false,
[Parameter(Mandatory=$false)]
[switch]$TerminalServerMode = $false,
[Parameter(Mandatory=$false)]
[switch]$DisableLogging = $false
)

Try {
## Set the script execution policy for this process
Try { Set-ExecutionPolicy -ExecutionPolicy ‘ByPass’ -Scope ‘Process’ -Force -ErrorAction ‘Stop’ } Catch {}

##*===============================================
##* VARIABLE DECLARATION
##*===============================================
## Variables: Application
[string]$appVendor = 'Microsoft'
[string]$appName = 'Office 365 2016'
[string]$appVersion = ''
[string]$appArch = ''
[string]$appLang = 'EN'
[string]$appRevision = ''
[string]$appScriptVersion = ''
[string]$appScriptDate = '20/02/2017'
[string]$appScriptAuthor = 'Azola'
##*===============================================
## Variables: Install Titles (Only set here to override defaults set by the toolkit)
[string]$installName = ''
[string]$installTitle = ''

##* Do not modify section below
#region DoNotModify

## Variables: Exit Code
[int32]$mainExitCode = 0

## Variables: Script
[string]$deployAppScriptFriendlyName = 'Deploy Application'
[version]$deployAppScriptVersion = [version]'3.6.8'
[string]$deployAppScriptDate = '02/06/2016'
[hashtable]$deployAppScriptParameters = $psBoundParameters

## Variables: Environment
If (Test-Path -LiteralPath 'variable:HostInvocation') { $InvocationInfo = $HostInvocation } Else { $InvocationInfo = $MyInvocation }
[string]$scriptDirectory = Split-Path -Path $InvocationInfo.MyCommand.Definition -Parent

## Dot source the required App Deploy Toolkit Functions
Try {
	[string]$moduleAppDeployToolkitMain = "$scriptDirectory\AppDeployToolkit\AppDeployToolkitMain.ps1"
	If (-not (Test-Path -LiteralPath $moduleAppDeployToolkitMain -PathType 'Leaf')) { Throw "Module does not exist at the specified location [$moduleAppDeployToolkitMain]." }
	If ($DisableLogging) { . $moduleAppDeployToolkitMain -DisableLogging } Else { . $moduleAppDeployToolkitMain }
}
Catch {
	If ($mainExitCode -eq 0){ [int32]$mainExitCode = 60008 }
	Write-Error -Message "Module [$moduleAppDeployToolkitMain] failed to load: <code>n$($_.Exception.Message)</code>n `n$($_.InvocationInfo.PositionMessage)" -ErrorAction 'Continue'
	## Exit the script, returning the exit code to SCCM
	If (Test-Path -LiteralPath 'variable:HostInvocation') { $script:ExitCode = $mainExitCode; Exit } Else { Exit $mainExitCode }

}

#endregion
##* Do not modify section above
##*===============================================
##* END VARIABLE DECLARATION
##*===============================================

	
If ($deploymentType -ine 'Uninstall') {
    ##*===============================================
	##* PRE-INSTALLATION
	##*===============================================
	[string]$installPhase = 'Pre-Installation'
	
	## Show Welcome Message, close Internet Explorer if required, allow up to 3 deferrals, verify there is enough disk space to complete the install, and persist the prompt
	Show-DialogBox -Title 'Installazione Office 365 2016' -text "Attenzione l'Office 365 installato sul tuo pc sta per essere aggiornato alla versione 2016, chiudi tutte le applicazioni Office prima di procedere" -Icon 'Information'
    Show-InstallationWelcome -CloseApps 'outlook,excel,winword,visio,' -AllowDefer -DeferTimes 3
	
	## Show Progress Message (with the default message)
	Show-InstallationProgress


	##*===============================================
	##* INSTALLATION 
	##*===============================================
	[string]$installPhase = 'Installation'
	
	
		
	## &lt;Perform Installation tasks here&gt;
    $visio = 'C:\Program Files\Microsoft Office 15\root\office15\VISIO.EXE'
    $Project = 'C:\Program Files\Microsoft Office 15\root\office15\WINPROJ.EXE'
    $x64 = Get-RegistryKey -Key 'HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\15.0\Word'
    If ($x64 -eq $null)
    {
    ## Disinstalla Tutto e Installa O365 2016 x86 e Visio e Project
    If((test-path $visio) -and (test-path $Project))
         {
          execute-process -path '\\fs011nas\0a31ops-software_center\MSOffice\O365\Office2013\setup.exe' -parameter '/configure \\fs011nas\0a31ops-software_center\MSOffice\O365\Office2013\UninstallAll.xml'
          execute-process -path '\\fs011nas\0a31ops-software_center\MSOffice\O365\Project2016\setup.exe' -parameter '/configure \\fs011nas\0a31ops-software_center\MSOffice\O365\Project2016\Install.xml'
          execute-process -path '\\fs011nas\0a31ops-software_center\MSOffice\O365\Visio2016\setup.exe' -parameter '/configure \\fs011nas\0a31ops-software_center\MSOffice\O365\Visio2016\Install.xml'
          execute-process -path '\\fs011nas\0a31ops-software_center\MSOffice\O365\Office2016\updfrom2013.bat'
          }
    ## Disinstalla Tutto e Installa O365 2016 x86 e Visio
    If(test-path $visio) 
         {execute-process -path '\\fs011nas\0a31ops-software_center\MSOffice\O365\Office2013\setup.exe /configure \\fs011nas\0a31ops-software_center\MSOffice\O365\Office2013\UninstallAll.xml'
          execute-process -path '\\fs011nas\0a31ops-software_center\MSOffice\O365\Visio2016\setup.exe /configure \\fs011nas\0a31ops-software_center\MSOffice\O365\Visio2016\Install.xml'
          execute-process -path '\\fs011nas\0a31ops-software_center\MSOffice\O365\Office2016\updfrom2013.bat'
          }
    ## Disinstalla Tutto e Installa O365 2016 x86 e Project
    If(test-path $Project) 
         {execute-process -path '\\fs011nas\0a31ops-software_center\MSOffice\O365\Office2013\setup.exe /configure \\fs011nas\0a31ops-software_center\MSOffice\O365\Office2013\UninstallAll.xml'
          execute-process -path '\\fs011nas\0a31ops-software_center\MSOffice\O365\Project2016\setup.exe /configure \\fs011nas\0a31ops-software_center\MSOffice\O365\Project2016\Install.xml'
          execute-process -path '\\fs011nas\0a31ops-software_center\MSOffice\O365\Office2016\updfrom2013.bat'
          }
  execute-process -path '\\fs011nas\0a31ops-software_center\MSOffice\O365\Office2016\updfrom2013.bat'
  execute-process -path "\\fs011nas\0a31ops-software_center\MSOffice\O365\Office2016\InstallProof2016x86.bat"
        
   }

   Else

   {
   ## Installa O365 2016 x64
  execute-process -path '\\fs011nas\0a31ops-software_center\MSOffice\O365\Office2016x64\updfrom2013.bat'
  execute-process -path "\\fs011nas\0a31ops-software_center\MSOffice\O365\Office2016\InstallProof2016x64.bat"
   }

  Copy-File -Path "\\fs854nas\0a31ops-software_center\MSOffice\O365\PsLoggedon.exe" -Destination "$envTemp\PsLoggedon.exe"
  Copy-File -Path "\\fs854nas\0a31ops-software_center\MSOffice\O365\CheckO365Installation.bat" -Destination "$envTemp\CheckO365Installation.bat"
  execute-process -path "$envTemp\CheckO365Installation.bat"


##*===============================================
##* END SCRIPT BODY
##*===============================================

## Call the Exit-Script function to perform final cleanup operations
Exit-Script -ExitCode $mainExitCode

}
}
Catch {
[int32]$mainExitCode = 60001
[string]$mainErrorMessage = “$(Resolve-Error)”
Write-Log -Message $mainErrorMessage -Severity 3 -Source $deployAppScriptFriendlyName
Show-DialogBox -Text $mainErrorMessage -Icon ‘Stop’
Exit-Script -ExitCode $mainExitCode
}

The log says that:
Installation] :: Function failed, setting exit code to [60002].
Error Record:

Message : File [\fs011nas\0a31ops-software_center\MSOffice\O365\Office2
013\setup.exe] not found.
InnerException :

FullyQualifiedErrorId : File [\fs011nas\0a31ops-software_center\MSOffice\O365
Office2013\setup.exe] not found.

PositionMessage :
At \fs854nas\0a31ops-software_center\MSOffice\O365\AppDeploy
Toolkit\AppDeployToolkitMain.ps1:2697 char:11
+ Throw <<<< “File [$Path] not found.”

Any help?
The file allready exists

HI,

Are you running your script manually or with SCCM? Do you have full access to setup.exe? I suggest you never post a server name on a forum.

For your error, check your path. May be just running powerhell with debugging will show your issue. Just use a breakpoint.

Thanks,

Hi,
i’m running with sccm i have full access to setup.exe.
The path is ok
The strange thing is the url not found has a great space into it…

If the package runs as SYSTEM then you need to make sure the machine is able to connect to the share. You could allow machines on the share by adding groups “Domain Computers” or “Authenticated Users” to the share location.

Another option is to download the files to the client cache. You can put the Office installation files in the “Files” folder and refer to them by using $dirFiles. For instance “$dirFiles\Setup.exe”

Hi,

Another option would be to run it as a task sequence.

Thanks,

Unfortunatly nothing changed

Are you sure the locations are correct? Your script is pointing to \fs011nas\ and later on it is pointing to \fs854nas. Could you try to move the parameters to -Parameters?

Just a tip. Create a variable to store the location. This will save you some time on checking for a typo.

$O365FileShare = '\\fs011nas\0a31ops-software_center\MSOffice\O365'

Uninstall All Office 2013 applications.

Execute-Process -Path “$O365FileShare\Office2013\setup.exe” -Parameters “/configure $O365FileShare\Office2013\UninstallAll.xml”

Hi i do try it…but the same error…
the fs854nas is an alias of fs011nas…

<Perform Installation tasks here>

    $visio = 'C:\Program Files\Microsoft Office 15\root\office15\VISIO.EXE'
    $Project = 'C:\Program Files\Microsoft Office 15\root\office15\WINPROJ.EXE'
    $x64 = Get-RegistryKey -Key 'HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\15.0\Word'
    $O3652013 = '\\fs011nas\0a31ops-software_center\MSOffice\O365\Office2013'
    $Pro3652016 = '\\fs011nas\0a31ops-software_center\MSOffice\O365\Project2016'
    $Vis3652016 = '\\fs011nas\0a31ops-software_center\MSOffice\O365\Visio2016'
    $O365 = '\\fs011nas\0a31ops-software_center\MSOffice\O365\Office2016'
    If ($x64 -eq $null)
    {
    ## Disinstalla Tutto e Installa O365 2016 x86 e Visio e Project
    If((test-path $visio) -and (test-path $Project))
         {
          execute-process -path "$O3652013\setup.exe" -parameter "/configure $dirfiles\Office2013\UninstallAll.xml"
          execute-process -path "$Pro3652016\setup.exe" -parameter "/configure $Pro3652016\Install.xml"
          execute-process -path "$Vis3652016\setup.exe" -parameter "/configure $Vis3652016\Install.xml"
          execute-process -path "$O365\updfrom2013.bat"

Hi,

Did you tried setting a breakpoint and then running line by line until you find the error (F9)?

Thanks,