Showing posts with label InstEd. Show all posts
Showing posts with label InstEd. Show all posts

Sunday, 18 February 2018

Packaging and Deploying Oracle Java runtime in SCCM 2007


Having trouble packaging Oracle Java in SCCM? Can't find the MSI? Once you installed Java you still have the old version as well? Today I'll explain how I to successfully deploy Oracle Java while removing older versions and be able to keep your estate to a standardized version.


1.    Visit http://www.java.com/en/download/ for the latest Java version
2.    Click “All Java Downloads”


3.    Select the “Windows Offline” version.


4.    Right click on the program and click “Run as administrator”, enter your EA credentials

5.    When the Java Welcome Screen appears don’t do anything, leave this open but don’t click “install”.


6.    Browse to the following location. Replace with your own username.

C:\Users\%username%AppData\LocalLow\Sun\Java\

In this folder you will find a subfolder with the MSI version you are attempting to install. Copy this folder to your desktop. You can now click “cancel” on the open installer.

7.    Copy the the files to the source location you use for deployment and give it a relevant name.




8.    Open up the MSI in your favourite MSI editor. In this example I'm using InstEd and click on “Transform” > New Transform. Give the Transform file a suitable name containing the product and version it’s intended for




9.    Make any modifications required to the MSI transform.

In the case of Oracle Java, we simply must disable Automatic updates via “AUTOUPDATECHECK” on the Property table. But there are other common checks you should perform such as ProductLanguage must always be 1033 (English), AllUsers should be set to 1 (this specifies a per machine context). Always ensure to create a new Transform file for each new version.


10.    Click “File” and Save, press OK when prompted.



10. In the SCCM Console, browse to software distribution > Packages and right click and choose New > Package from definition.


11.    Click next, Browse and then browse to the location of the extracted MSI, select the MSI.



12.    The Wizard will now show the product and version number, ensure this is correct and then click next. It’s important to check that this information is correct as this has the potential to replace a previous piece of software in the database. There have been several occasions where the version number clashes with a previous one. In this case you can contact the vendor and ask them to supply a changed version, or you can alter the version number for yourself in Instead (property table).




13.    Select “Always obtain files from the source directory” and click Next.
14    Click Next



15.    Click Finish



16.    Expand the new package on the left-hand pane and click on “distribution points”




17.    On the right-hand pane click “New Distribution points” and the click next on the wizard once it appears.

18.    Select the the relevant distribution point and click next. Note you will want to distribute the package to all distribution points once testing is completed. Do not copy the package to any shares marked SMSPXEIMAGES$ 


19.    Click “Close”

20.    On the left-hand pane right-click on “Programs” and select New > Program.


21.    Enter the Program name “Install Vendor, Product, Version”

eg: Install Oracle Java 8 Update 8.0.40.

22.    Enter the installation string under “Command Line”

eg: msiexec /i jre1.8.0_40.msi TRANSFORMS=Oracle_Java_RT_8040_AA.mst /qn

Click Next.


23.    Select the platform the program can be run on. Click Next.



24.    Select “Whether or not a user is logged on” and click next.



25.   In my organisation I'll be using the program for OSD and completely silent installation. I'll choose “Suppress Program Notifications” and “Allow this program to be installed from the install software task sequence without being advertised”.


26.    Select “import” and choose the installer you used, this will the import the product GUID and enable MSI source management. Record this GUID, we will use it later. Click Next.


27.    Click Next and on the review all details page click next again.

28.    Check the program creation was successful (indicated by green ticks) then click Close.


29.    We will now create a new Program to remove this version of Java, the steps for this are essentially the same as those for the first program. This time, we will use the program GUID that we recorded earlier to remove the software; this will ensure that only this unique version will be removed.

 **Important** do not enable MSI source management for the removal job.

eg: the full uninstall sting is msiexec /x {26A24AE4-039D-4CA4-87B4-2F83218025F0} /qn



30.    Right click on collections and create a “New Collection” and fill in the name of the collection name, click Next.


31.    Click Next 


32.    Press “OK” when prompted with "the collection has no membership rules" we will resolve this later. Click next, then Finish.


33.   The newly created collection will then show in the left-hand pane. We will now create a sub-collection within this collection for the pilot group. Essentially the process is a repeat of the above steps with the collection name changed. When you have done this you will have a collection within a collection similar to below.


34. We will now generate a report of all versions of Java within the estate so we know which version we need to remove.  On the left-hand pane click “Asset Intelligence” > “Asset Intelligence Reports”. On the reading pane beside “Look for” enter Search for installed software”.


35.    Right Click the report and choose “run”

36.    When the report appears select “values” and select the SMS00001 collection (all systems). Enter %Java% in the “Enter a part of the product name” field and then click “Display”

37.    The report produced will show all known Java versions in the estate, we are interested in the “Software ID” field, these GUIDS will be used these to ensure that all previous versions are removed from a system before installing the new version. Keep this report open.

**Important** Programs other than the one you are searching for may appear




38.    Open the location you stored your Java MSI and create a new text document in notepad, save as“Oracle_Java_Removal.cmd” file and reopen this up with notepad.

The .cmd should start with the following tasks to close open browsers and kill relevant processes that may stop the uninstall from being successful.

@ECHO OFF
REM Close all open web browsers
:killfirefox
taskkill /f /t /im firefox.exe
tasklist /FI "IMAGENAME eq firefox.exe" 2>NUL | find /I /N "firefox.exe">NUL
if "%ERRORLEVEL%"=="0" GOTO killfirefox
:killiexplore
taskkill /f /t /im iexplore.exe
tasklist /FI "IMAGENAME eq iexplore.exe" 2>NUL | find /I /N "iexplore.exe">NUL
if "%ERRORLEVEL%"=="0" GOTO killiexplore
:killchrome
taskkill /f /t /im chrome.exe
tasklist /FI "IMAGENAME eq chrome.exe" 2>NUL | find /I /N "chrome.exe">NUL
if "%ERRORLEVEL%"=="0" GOTO killchrome
REM Close all JAVA Background Processes
:killjusched
taskkill /f /t /im jusched.exe
tasklist /FI "IMAGENAME eq jusched.exe" 2>NUL | find /I /N "jusched.exe">NUL
if "%ERRORLEVEL%"=="0" GOTO killjusched
:killjucheck
taskkill /f /t /im jucheck.exe
tasklist /FI "IMAGENAME eq jucheck.exe" 2>NUL | find /I /N "jucheck.exe">NUL
if "%ERRORLEVEL%"=="0" GOTO killjucheck
:killjqs
taskkill /f /t /im jqs.exe
tasklist /FI "IMAGENAME eq jqs.exe" 2>NUL | find /I /N "jqs.exe">NUL
if "%ERRORLEVEL%"=="0" GOTO killjqs

 Next  add your GUIDS from the report line by line in this format.

msiexec.exe /qn /norestart /x {B048D821-636D-43D9-82EC-8B0010734231} 
msiexec.exe /qn /norestart /x {726880D7-98DE-41CC-B553-E6084260CFB7} 
msiexec.exe /qn /norestart /x {0C933B8C-1154-4EC8-8832-55CEAACA3B13} 
msiexec.exe /qn /norestart /x {3076929A-FB47-4CB7-A8FF-72CB95C22F95}

End the script with 

exit /B %EXIT_CODE%

Ensure to save the script.

**IMPORTANT** you should also INCLUDE the GUID of the latest version you are deploying. This will ensure that any installations of that version on the estate are the managed version you have distributed from SCCM.


 39.    Now open the SCCM console and browse to “Software distribution” > Packages and find your Java package. Click “Update distribution points” on the right-hand pane. When prompted by the “Confirm Update distribution points” box click “Yes”


40.    In the SCCM Console browse to “Operating System Deployment” > Task Sequences >Create a new "basic task sequence called "Install Oracle Java Versionname". 

41.    Right Click on the newly duplicated task sequence and click “properties”

42.    In the “Name” field, update it to the include the include the product and  latest version you are deploying. Press “Apply” when finished.





43.    Back to the main console window, right click on the newly renamed task sequence and choose “edit”

44.    Create a new group at the top level with the version being deployed. inside this add a "remove all oracle java" step as a "run command line". Ensure to set the package to the Java package you created earlier. I've also set the "continue on error" option for this in case there is an unknown exit code returned.



45.    Add a "delay step as step 2" this is just a "run command line" step with the command set to ping a loopback address for approx 20 seconds.



46.    Lastly add a "install program" step and add the program we created earlier, ensure the "install" program is selected.


47.    Right click on the newly created Task Sequence and then click “advertise”.

48.    Click “Browse” beside collection: and then select the “Pilot” collection you created earlier. Click OK.


49.    Click Next


50.    Click the “Sun” button beside “Mandatory assignments” and select “Immediately after this event” and “As soon as possible” from the drop-down menu, click OK.


51. Select “High” priority, and “Always rerun program” and click next.


52.     Select “download all contents locally before starting task sequence”, “when no local distribution point is available, use a remote distribution point” and “when no protected distribution point is available, use an unprotected distribution point”. Click Next.


53.    Click next three times and finally click close.



The pilot application is now ready for deployment testing. You can now add clients directly into the pilot collection, any previous versions of Java will be removed before installing the new version. 

When you are satisfied that your deployment works and removes all previous versions you should the create a new collection for rollout set it to refresh every day, use a query based collection to search for all systems with Java installed not at the same version you want to deploy (example below)

Exclusions for systems can also be added as below.


When this collection becomes empty, the deployment will have been successful to the estate.

You can keep track of the systems you've upgraded by using another collection with query containing the version you are deploying. (as below)



When you run the job all versions will be replaced with this new version. You can keep your estate at this version by adding any newly released versions GUIDS to the removal script, or upgrade to a newer version by simply replacing the package with the new version.

I appreciate this is a long post, if you've stuck with me this far, thanks for that. As always feedback is appreciated by way of the comments section, also feel free to give me a +1 to help the search ranking of this page. Many thanks.


Wednesday, 17 July 2013

How to get the MSI file from VMware-viclient-5.1.exe or any other VMware vSphere Client!


This guide works in general for any other version of VMWare Vsphere client, the installers have been packaged in pretty much the same way since I first used it in version 4.0. Why would you want to extract an MSI from the .exe even although it already supports silent installations you ask? Well, it’s true that it does, you can use the below command line string to extract from the pass commands into the internal MSI via the installshield wrapper.

vmware-viclient.exe /a /s /v" /qn TARGETDIR=C:\vSphereviclient5"

The issue I have with this is that it simply doesn’t work when being deployed via SCCM 2007. The reason for this is likely to be the contained prerequisite packages “vcredist_x64.exe” and “vcredist_x86.exe”. Most systems will already have these installed so all that’s happening here is unneeded complexity is being added to the package.

Follow the below steps if you want to grab that MSI!

1.   Right Click on the package and extract with either Winrar or 7-zip.This file is actually just a Winrar self extractor!


 
2.    You will be left with a new folder containing a “bin” and “redist” folder. We are only interested in the contents of the “bin” folder.


 
3.    Open the “Bin” folder and find “Vmware-viclient.exe” doubleclick this package to begin the installation.
 
4.   When the “welcome” screen appears don’t go any further. Instead browse to “C:\Users\yourusername\AppData\Local\Temp\”  (in W7 x64) .
 
 
 
 
5.    Inside here you will find a folder containing the MSI for the package. The name of the folder won’t be obvious; as it uses the MSI product code as the folder name, but if you do a “sort by date modified” the newest folders are likely to contain the package.


 
6.    You can now take all the files from here for deployment. As with any MSI you can use standard MSIEXEC commands to complete the installation:
eg: msiexec /i “Vmware vSphere Client 5.1.msi” Transforms=”1033.MST” REBOOT=REALLYSUPPRESS /qn for silent installation.
 
Or msiexec /i “Vmware vSphere Client 5.1.msi” Transforms=”1033.MST” REBOOT=REALLYSUPPRESS /qb for passive installation.
See http://support.microsoft.com/kb/314881 for a complete list of MSI switches.
 
If you run into difficulties with the system rebooting after installation automatically, you can edit this setting in the transforms file by using a program such as InstED.
 
 
 
 
 
 



Sunday, 18 December 2011

Installing Exchange System Manager for Windows Vista on Windows 7 x64

Like many companies mine has not yet got around to upgrading to Exchange 2007 or 2010. When you want to encourage the move to a full Windows 7 environment this can be an issue as there are no management tools available for this older version of Exchange. The last thing you want is to have all admins logging onto the server to check simple things such as tiers, configure addresses etc.

Luckily Microsoft did release Exchange System Manager for Windows Vista - but a badly configured MSI means that you won't be able to install this on Windows 7.




Even when attempting to run the program in compatibility mode you are still greeted with the same unfriendly error message.


Fortunately I found a way around this. You will require to install an MSI editor such as InstEd or Orca. I personally prefer InstEd as it has many more features. Simply open up the MSI in InstEd and navigate to "InstallUISequence" and select the "CA_SET_ERROR_MSG" and "FatalErrorDialog" entries, right click and choose "Delete Rows".



You can now click "File" > "Save as" > "ESMVISTA_FIXED.MSI". You should now be able to run the installer without any annoying warnings. I have tested this over the last few weeks and it works flawlessly.


Ah - good old T&C - a welcome sight.

Fully installed and working

As it turns out, The Exchange Management tools are not the only program affected by this issue. So far using this method I have managed to resolve issues with Cisco Unified Desktop Supervisor, Agent and Cisco Unified Desktop Administrator. The rows you have to delete are going to be a little different, but usually it's a rather obvious OS check that is pretty easy to spot. If you decide to use this tip just be sure to inform you manager that this is work-around, not a permanent fix - the moment you do this you are saying that you need no support from the supplier.

Andrew