another technical blog...technically

Monday, December 8, 2014

Howto to deal with workflow manager when it refuses to install

This is what happens when you come back from a vacancy week:
  • Your (personal) mobile phone rings (yep i don't have a enterprise one) and customer asks why workflow manager installer for SP2013 farm, literally, "doesn't work" 
  • You take tube and bus (with 30° C) to reach customer office
  • You skip launch to discover the problem
  • You came back to the office and you continue your work till late
  • You start thinking about opening a bar in Copacabana
As usual /mode joke off
Today i will talk about safest installation procedure of workflow manager on SP2013 farm. Customers, very often configure farm server doing stuffs as block incoming connections or setting locale in such strange ways.
This could cause Web Platform installer strange behaviours and mainly Service Bus installation failure with this error (which is related to Windows Fabric, a Service Bus dependency)
Error
When i tried to install Workflow Manager stuffs i got this error:
Event ID 11722 Product: Windows Fabric — Error 1722. There is a problem with this Windows Installer package. A program run as part of the setup did not finish as expected. Contact your support personnel or package vendor. Action DoFabricSetup, location: C:Program FilesWindows abricbinFabricFabric.Code.1.0MSIHiddenAppLauncher.exe, command:FabricSetup /operation:install /gac
Like you can read on this blog post (a real life-saving one: http://blog.riccardocelesti.it/workflow-manager-setup-issue/) this is due to locale settings. Service Bus and its dependencies can be installed only with locale settings en-us, but the check will let you install this piece of sotware it's only on this registry key.

Solution
So i built this little script, which is helpful to install workflow manager flawlessy.
Write-Host "Getting sTimeFormat RegEx value ... " -NoNewLine;
$regVal =  Get-ItemProperty -Path "Microsoft.PowerShell.Core\Registry::HKEY_USERS\.DEFAULT\Control Panel\International" -Name "sTimeFormat"
Write-Host "DONE" -ForeGroundColor GREEN;

$oldFormat = $regVal.sTimeFormat;
Write-Host "Old time format was: $oldFormat" -BackgroundColor YELLOW -ForeGroundColor BLACK;

Write-Host "Setting sTimeFormat RegEx value ... " -NoNewLine;
Set-ItemProperty -Path "Microsoft.PowerShell.Core\Registry::HKEY_USERS\.DEFAULT\Control Panel\International" -Name "sTimeFormat" -value "h:mm:ss tt";
Write-Host "DONE" -ForeGroundColor GREEN;

Write-Host "Download web platform installer ... " -NoNewLine;
$source = "http://download.microsoft.com/download/7/0/4/704CEB4C-9F42-4962-A2B0-5C84B0682C7A/WebPlatformInstaller_amd64_en-US.msi";
$destination = "c:\WebPlatformInstaller_amd64_en-US.msi";
Invoke-WebRequest $source -OutFile $destination;
Write-Host "DONE" -ForeGroundColor GREEN;

Write-Host "Installing web platform installer ... " -NoNewLine;
Start-Process c:\WebPlatformInstaller_amd64_en-US.msi -Wait;
Write-Host "DONE" -ForeGroundColor GREEN;

Write-Host "Refreshing WebPI products ... " -NoNewLine;
Start-Process "C:\Program Files\Microsoft\Web Platform Installer\webpicmd" -ArgumentList '/offline','/Products:WorkflowManagerRefresh','/Path:c:/WorkflowManagerFiles' -Wait;
Write-Host "DONE" -ForeGroundColor GREEN;

Write-Host "Installing workflow manager software ... " -NoNewLine;
Start-Process "C:\Program Files\Microsoft\Web Platform Installer\WebpiCmd.exe" -ArgumentList '/Install','/Products:WorkflowManagerRefresh','/XML:c:/WorkflowManagerFiles/feeds/latest/webproductlist.xml' -Wait;
Write-Host "DONE" -ForeGroundColor GREEN;

Write-Host "Starting workflow manager configurator ... " -NoNewLine;
Start-Process "C:\Program Files\Workflow Manager\1.0\Microsoft.Workflow.Deployment.ConfigWizard.exe" -Wait;
Write-Host "DONE" -ForeGroundColor GREEN;

Write-Host "Resetting sTimeFormat RegEx value to $oldFormat ... " -NoNewLine;
Set-ItemProperty -Path "Microsoft.PowerShell.Core\Registry::HKEY_USERS\.DEFAULT\Control Panel\International" -Name "sTimeFormat" -value $oldFormat;
Write-Host "DONE" -ForeGroundColor GREEN;

Write-Host "Cleaning files ... " -NoNewLine;
Remove-Item $destination;
Remove-Item "c:/WorkflowManagerFiles";
Write-Host "DONE" -ForeGroundColor GREEN;

Read-Host "Press any key to exit";
It could be done better, for example using powershell also for workflow manager configuration, maybe i'll do something similat for Azure SPFarm Manager.
Once you run the script, at first the sTimeFormat will be forced in the registry key, so installation could proceed on any locale configured SharePoint farm.



At the end the original value will be restored.
 And that's all, you can also download the code from here. Enjoy.
written in: Milano, Italia

0 commenti:

Post a Comment

Because of a lot of SPAM about courses, I need to moderate all comments here.
I ensure you that I will answer whenever possible (if you are not a spammer).

Me, myself and I

My Photo
I'm just another IT guy sharing his knowledge with all of you out there.
Wanna know more?