Prerequisites.json InstallWebDeploy3.6 : StartProcess task error in Windows 10

Sitecore 10.3 just released. Here is a common error you could encounter if you tried to install Sitecore 10.3 using SIF. This is not specific to Sitecore 10.3 but a general error whenever you try running Prerequisites.json with the wrong PS command prompt. Blogged it since I couldn't find any search results.

Error:

[------------------------------------- InstallWebDeploy3.6 : StartProcess --------------------------------------------]

Install-SitecoreConfiguration : This command cannot be run due to the error: The system cannot find the file specified.

At line:1 char:1

+ Install-SitecoreConfiguration -Path .\Prerequisites.json

+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorException

    + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Install-SitecoreConfiguration


[TIME] 00:01:35

Start-Process : This command cannot be run due to the error: The system cannot find the file specified.

At C:\Program Files(x86)\WindowsPowerShell\Modules\SitecoreInstallFramework\2.3.0\Public\Install-SitecoreConfiguration.ps1:641 char:25

+                         & $entry.Task.Command @paramSet | Out-Default

+                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : InvalidOperation: (:) [Start-Process], InvalidOperationException

    + FullyQualifiedErrorId : InvalidOperationException,Microsoft.PowerShell.Commands.StartProcessCommand


Cause:


This error could occur if the WebpiCmd.exe is not available in the concerned path. For instance, in this case, the script was looking under C:\Program Files (x86)\Microsoft\Web Platform Installer but the exe was actually present under C:\Program Files\Microsoft\Web Platform Installer

The most likely cause is you were using Windows PowerShell (x86) Command prompt instead of Windows PowerShell Command prompt  since Environment("ProgramFiles") in x86 command prompt will return C:\Program Files (x86) and thus the exe will be unavailable for the script.

Once the correct PS command prompt was used, the InstallWebDeploy3.6 task was successful:


Another option is to use Environment("ProgramW6432") instead of Environment("ProgramFiles") in the prerequisites.json file so that the result is always c:\ Program Files irrespective of the cmd prompt used. 


End-result of the concerned change in prerequisites.json  and executing in x86 prompt  is successful:


Will try raising a Sitecore support ticket and check if this is a feasible solution for the issue.

Comments