Deployment Mad Scientist Bending software to my will.Welcome to part two of a five part series on deploying runtimes and reader from Adobe with an app store like experience using Microsoft System Center Configuration Manager.Todays episode Shockwave PlayerA.Outlook 98 and Outlook 2000 will prompt you when starting to set as the default mail client if they are not already configured as such however if you.Within Lync you can use inband provisioning to perform most of the Clientside settings.An overview of these settings can be found here httptechnet.RBackup gives you the freedom to host your own Online Backup Service on your own server or in any data center, including most cloud solutions.Stay on top of your SCCM client health.Learn how to manage inactive and obsolete clients in SCCM Current Branch with statuses, reporting, and remediation.As I prepared to write, I asked myself, Does anyone use Shockwave anymore It turns out that the answer is pretty much a no, but Im going to stick with my plan to cover Shockwave, Flash, AIR, and Acrobat Reader in that order for completeness.Also, Shockwave is the only one of the four that is actually packaged appropriately by the vendor for an acceptable user experience, so it makes sense to cover it first so we can focus on the plumbing of building the application package.Each of these programs receives frequent updates, and it can be quite a task to build new application packages every few weeks.As I have mentioned previously, there are vendors that will take care of this for you, and I encourage you to use one of them if you can afford it and if it makes sense in your organization.My approach here will be to show a do it yourself method for automating app package creation for these frequent updates using Windows Power.Shell. Prerequisites.To follow along, you will need to have distribution rights from Adobe, Power.Shell 5. 0, and the Configuration Manager cmdlets.See my previous blog post for details.You may not technically need Power.Shell 5. 0, but thats what I have.Im not going to make any effort to ensure that what Im doing works on previous versions, so to make sure everything below works for you, I suggest upgrading to version 5.You can check your version of Power.Shell from a Power.Shell prompt by displaying PSVersion.Table. PSVersion.Heres the command and its output from my Windows 1.Power. Shell 5. 0 installed.PS C PSVersion. Table.PSVersion. Major Minor Build Revision.PSC PSVersion. Table.PSVersion. Major Minor Build Revision 5 0 1.Using Power. Shell for Packaging First Iteration.Lets begin by outlining the plan in comments.Well start with a simple, single use script and then refine it later.Download the Shockwave installer from Adobe.Extract the version information from the installer.Save the installer to the appropriate location.Extract the program icon.Create the application object in Configuration Manager.Download the Shockwave installer from Adobe Extract the version information from the installer Save the installer to the appropriate location Extract the program icon Create the application object in Configuration Manager Downloading.There are several ways to download a file from the web with Power.Shell. Im going to choose the simplest one which may not be the best one, depending on your criteria a built in Power.Shell cmdlet called Invoke Web.Request. Start by clicking the Shockwave link you received from Adobe.In the Shockwave Player Distribution Downloads table, right click the Download MSI Installer link, and choose Copy shortcut or its equivalent to copy it to the clipboard.Paste the URL into the Power.Shell script and assign it to a variable.This will be important later.Basically, were going to use Invoke Web.Request to download the file to a temporary folder.Unfortunately, things are never as easy as they sound.The download link provided by Adobe does not include a filename, but Invoke Web.Request needs one in order to save the file.It is important to me, at least to use the real filename of the file rather than something arbitrary.Also, the link provided by Adobe redirects elsewhere, which complicates matters.Here is the somewhat scary looking code, and an explanation follows.Download the Shockwave installer from Adobe.Uri Shockwave download URI.We dont know the installers filename, so generate a temporary one until the file is downloaded.Web. Response. Object.Out. Filename System.IO. Path Get. Random.File. Name. temp.Out. File. Path env TEMPtemp.Out. Filename. Download the installer and save it to a temporary location and filename.The Pass. Thru switch puts a Web.Response. Object in the pipeline in addition to writing the file.Invoke Web. Request Uri Uri Out.File temp. Out. File.Path Pass. Thru. Get the filename from the Web.Response. Object.Filename System. IO.Path Get. File. Nameresponse.Base. Response. Response.Uri. Absolute. Uri.If the target file already exists, delete it.If the file does not exist, Remove Item returns an error, so ignore errors.File. Path env TEMPout.Filename. Remove Item Path out.File. Path Force Error.Action Ignore. Rename the temporary file with its proper name.Rename Item Path temp.Out. File. Path New.Name out. Filename.Remove zone identifier.Unblock File Path out.File. Path. 1. 23.Download the Shockwave installer from AdobeUri Shockwave download URI We dont know the installers filename, so generate a temporary one until the file is downloaded and we can get the filename from the Web.Response. Object. How To Activate Airtel Live Services Saint . Out. FilenameSystem.IO. Path Get. Random.File. Nametemp. Out.File. Pathenv TEMPtemp.Out. Filename Download the installer and save it to a temporary location and filename.The Pass. Thru switch puts a Web.Response. Object in the pipeline in addition to writing the file.Invoke Web. Request UriUri Out.Filetemp. Out. File.Path Pass. Thru Get the filename from the Web.Response. Object.FilenameSystem. IO.Path Get. File. Nameresponse.Base. Response. Response.Uri. Absolute. Uri If the target file already exists, delete it.If the file does not exist, Remove Item returns an error, so ignore errors.File. Pathenv TEMPout.FilenameRemove Item Pathout.File. Path Force Error.Action. Ignore Rename the temporary file with its proper name.Rename Item Pathtemp.Out. File. Path New.Nameout. Filename Remove zone identifier.Unblock File Pathout.File. PathObviously, replace the URI placeholder text with the appropriate download link from Adobe.Since that link does not include the filename, we generate one with a call into the.NET Frameworks System.IO. Path. Get. Random.Filename function.Next, we use Invoke Web.Request to download the file to a temporary folder.The Invoke Web. Request cmdlet puts its result on the pipeline as a Web.Response. Object unless you pass the Out.File parameter, in which case it puts nothing on the pipeline.The Pass. Thru switch overrides this behavior and puts the response object on the pipeline in addition to writing the output file.This object, which is captured by the response variable, contains the actual URI used to obtain the downloaded file after any redirects were followed.The System. IO. Path.Get. File. Name function extracts just the filename from this URI.We delete any existing file with the same name in the temporary folder and then rename the downloaded file with the proper name.Finally, we remove the zone identifier from the downloaded file with Unblock File in order to prevent security prompts when attempting to install the program later.For more information on this, see About URL Security Zones on Tech.Net. Scott Hanselman also has a great discussion of the zone identifier alternate data stream from 2.Power. Shell cmdlet we will use, so maybe it did not yet exist back then.Extracting Version Information.The download link and the file we downloaded does not contain any version information in the name, but we will need the version in order to make the Configuration Manager application.I have not found any built in Power.Shell cmdlets to extract version information from a Windows Installer MSI file, but fortunately, we have the Internet to help us I found a number of scripts in a number of places, but I chose to use the one from Nickolaj Andersen at scconfigmgr.Visit that link, follow the instructions there, and then come back here to continue.When youre finished, youll have a Get MSIFile.Information. ps. 1 file in the same folder as the script we are writing here.Since were leveraging an outside script for most of the work here, our own version extraction code is quite short.Extract the version information from the installer.Msi. Version. Get MSIFile.Information. ps. 1 Path out.File. Path Property Product.Version. Get MSIFile.Information returns an array for the Product.Version property.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
August 2018
Categories |