|
15.08.2013, 01:16 | #1 |
Участник
|
crminthefield: Use PowerShell: build a redist folder to install Dynamics CRM 2011 without an internet connection
Источник: http://blogs.msdn.com/b/crminthefiel...onnection.aspx
============== Most likely you’ve read Shawn Dieken’s wildly popular article on how to create a redist folder when installing CRM without an internet connection. Today I was presented with a customer scenario where a server that should have had internet access did not and thus, we had to install without internet access. No big deal, however after walking through the article I quickly realized this task, while effective, was pretty monotonous and not a lot of fun. I caught myself thinking “there must be a better way” – and turns out there was and all we needed to do was bring PowerShell into the mix! With a few lines of code and a little testing, I had a script to paste in to PowerShell and create my very own CRM 2011 Redist folder with all the pre-requisite files. Usually you find PowerShell scripts downloadable as PS1 files, but sometimes in scenarios like this I find myself just wanting to, copy my script, open PowerShell, Paste, and Go. With that in mind, this script can be simply copied and pasted into PowerShell so you can quickly build your redist folder. Instructions for use:
#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 Источник: http://blogs.msdn.com/b/crminthefiel...onnection.aspx
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору. |
|
|
|