Created
September 4, 2013 14:29
-
-
Save ccellar/6437743 to your computer and use it in GitHub Desktop.
build a redist folder to install Dynamics CRM 2011 without an internet connection
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# see http://blogs.msdn.com/b/crminthefield/archive/2013/08/14/use-powershell-build-a-redist-folder-to-install-dynamics-crm-2011-without-an-internet-connection.aspx | |
#begin Script | |
#Function to Show an Open Folder Dialog and return the directory selected by the user. | |
function Read-FolderBrowserDialog([string]$Message, [string]$InitialDirectory) | |
{ | |
$app = New-Object -ComObject Shell.Application | |
$folder = $app.BrowseForFolder(0, $Message, 0, $InitialDirectory) | |
if ($folder) { return $folder.Self.Path } else { return '' } | |
} | |
#download pre-req function, also creates the folders | |
function dlPreReq($root, $folderName, $fileName, $url) | |
{ | |
$fldr = Join-Path -Path $root -Child $folderName | |
$dest = Join-Path -Path $fldr -Child $fileName | |
#create folder if it doesnt exist | |
if((Test-Path -Path $fldr) -ne $True) | |
{ | |
New-Item -Path $fldr -ItemType directory | out-null | |
} | |
Write-Host ("Downloading {0} to path: {1} " -f $fileName, $fldr) | |
$wc = New-Object system.net.webclient | |
$wc.downloadFile($url,$dest) | |
} | |
#download each pre-req | |
function Create-CRM2011Redist() | |
{ | |
$folderRoot = (Read-FolderBrowserDialog "Pick the location to create the Dynamics CRM 2011 redist folder") | |
if(($folderRoot.length) -gt 0) | |
{ | |
$folderRoot = Join-Path -Path $folderRoot -Child "Redist" | |
dlPreReq $folderRoot dotNETFX "dotNetFx40_Full_x86_x64.exe" "http://go.microsoft.com/fwlink/?LinkId=182091&clcid=0x409" | |
dlPreReq $folderRoot DotNetServicesSDK WindowsAzureAppFabricSDK-x64.msi "http://go.microsoft.com/fwlink/?LinkId=178254&clcid=0x409" | |
dlPreReq $folderRoot IDCRL wllogin_32.msi "http://go.microsoft.com/fwlink/?LinkId=194721&clcid=0x409" | |
dlPreReq $folderRoot IDCRL wllogin_64.msi "http://go.microsoft.com/fwlink/?LinkId=194722&clcid=0x409" | |
dlPreReq $folderRoot MSI45 WindowsServer2003-KB942288-v4-x86.exe "http://go.microsoft.com/fwlink/?LinkID=139114&clcid=0x409" | |
dlPreReq $folderRoot MSI45 WindowsServer2003-KB942288-v4-x64.exe "http://go.microsoft.com/fwlink/?LinkID=139115&clcid=0x409" | |
dlPreReq $folderRoot MSI45 Windows6.0-KB942288-v2-x86.msu "http://go.microsoft.com/fwlink/?LinkID=139108&clcid=0x409" | |
dlPreReq $folderRoot MSI45 Windows6.0-KB942288-v2-x64.msu "http://go.microsoft.com/fwlink/?LinkID=139110&clcid=0x409" | |
dlPreReq $folderRoot MSI45 WindowsXP-KB942288-v3-x86.exe "http://go.microsoft.com/fwlink/?LinkID=139113&clcid=0x409" | |
dlPreReq $folderRoot MsoIdCrl msoidcli_32.msi "http://go.microsoft.com/fwlink/?LinkId=221498&clcid=0x409" | |
dlPreReq $folderRoot MsoIdCrl msoidcli_64.msi "http://go.microsoft.com/fwlink/?LinkId=221500&clcid=0x409" | |
dlPreReq $folderRoot ReportViewer ReportViewer.exe "http://go.microsoft.com/fwlink/?LinkId=193386&clcid=0x409" | |
dlPreReq $folderRoot SQLCE SSCERuntime-ENU-x86.msi "http://go.microsoft.com/fwlink/?LinkId=147327&clcid=0x409" | |
dlPreReq $folderRoot SQLCE SSCERuntime-ENU-x64.msi "http://go.microsoft.com/fwlink/?LinkId=147326&clcid=0x409" | |
dlPreReq $folderRoot SQLExpr SQLEXPR_x86_ENU.exe "http://go.microsoft.com/fwlink/?LinkId=179623&clcid=0x409" | |
dlPreReq $folderRoot SQLNativeClient sqlncli_x64.msi "http://go.microsoft.com/fwlink/?LinkId=178252&clcid=0x409" | |
dlPreReq $folderRoot VCRedist vcredist_x86.exe "http://go.microsoft.com/fwlink/?LinkId=195255&clcid=0x409" | |
dlPreReq $folderRoot VCRedist vcredist_x64.exe "http://go.microsoft.com/fwlink/?LinkId=195257&clcid=0x409" | |
dlPreReq $folderRoot WindowsIdentityFoundation Windows5.2-KB974405-x86.exe "http://go.microsoft.com/fwlink/?LinkId=200432&clcid=0x409" | |
dlPreReq $folderRoot WindowsIdentityFoundation Windows5.2-KB974405-x64.exe "http://go.microsoft.com/fwlink/?LinkId=200430&clcid=0x409" | |
dlPreReq $folderRoot WindowsIdentityFoundation Windows6.0-KB974405-x86.msu "http://go.microsoft.com/fwlink/?LinkId=190775&clcid=0x409" | |
dlPreReq $folderRoot WindowsIdentityFoundation Windows6.0-KB974405-x64.msu "http://go.microsoft.com/fwlink/?LinkId=190771&clcid=0x409" | |
dlPreReq $folderRoot WindowsIdentityFoundation Windows6.1-KB974405-x86.msu "http://go.microsoft.com/fwlink/?LinkId=190781&clcid=0x409" | |
dlPreReq $folderRoot WindowsIdentityFoundation Windows6.1-KB974405-x64.msu "http://go.microsoft.com/fwlink/?LinkId=190780&clcid=0x409" | |
} | |
else | |
{ | |
write-host "No folder selected, operation was aborted. Run Create-CRM2011Redist to retry." | |
} | |
} | |
#kick off the script | |
Create-CRM2011Redist | |
#end script |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment