Tagged group policy

Automating uninstall of multiple Java versions

Java LogoRecently at work, I had to come up with a way to uninstall any installed versions of Java on our AD managed systems, then install versions 1.5.11 and 1.4.2.12 (the latest versions of 1.5 and 1.4, essentially). Luckily, Alan found a site that directly addresses this issue, and I was able to quickly grab all the upgrade codes for the previous Java MSIs. Armed with this info, I quickly inserted all the upgrade codes into the 1.5.11 JRE MSI, which I had extracted from the setup .exe bootstraper (it’s in %username%\Local Settings\Application Data\Sun\Java\jre1.5.0_11). I tested it with 1.5.10 on my system, and it upgraded it like a charm.

Since the upgrade code for each sub-version is different (why, Sun, why?), you have to paste about 20 codes in one by one, which is a major pain. As a service, I’ve created an MSI that is only the upgrade codes. Just paste the upgrade table of this MSI into the Sun Java one (I’m not providing a hacked MSI on this site, that would just be stupid), and you’re good to go, and you can avoid the 20 stupid table entries. Here’s the file:
Download Java Upgrade Code MSI Version 1.0

java, jre, uninstall java, automatic uninstall java, MSI, AD, group policy, active directory, sun java

Deploying applications with Group Policy

Windows Server 2003 offers systems administrators a new* and exciting tool for deploying applications across the domain: MSI deployment with Group Policy using Active Directory. Basically, if you can turn any app setup into an MSI, you can easily push it to any and all machines on your domain through Group Policy. Using the silent flag for msiexec, you can make these installs completely automatic, with no user interaction whatsoever. When your user boots up the machine, there is a slight delay while the MSI installs, advertised by a small dialog box in the top left corner, which indicates what app is being installed. After the install is complete, the user will be logged in completely normally, with the new app available to them. For a detailed walkthrough on deploying your app through Group Policy, click here. You can also read the Microsoft documentation here.

* I know, Microsoft claims this worked in Server 2000. Did you try it?
.msi, GPO, active directory, app deployment, application deployment, deploy application, group policy, install application remotely, msi, remotely deploy msi, systems administrator

Streaming an external cabinet file into an MSI

If you’ve worked with MSIs before, you’re aware that you can either stream setup files with the MSI directly, or attach them separately in .cab cabinet files to be extracted at run-time. The former method saves file space: when the user installs the program, only the MSI is cached in WINDOWS\Installer, so the data in the cabinet does not occupy space on the user’s hard drive. The downside, of course, is that you can no longer get clean copies of those files during a re-install unless you have the original installation media. The other major downside, from an Active Directory standpoint, is that you can only push single MSIs with Group Policy, not multi-file installs.
So, if you have an MSI with a separate .cab file, what’s the easiest way to stream that cabinet? First you’ll need the Windows Installer SDK (available separately from the 1.2Gb Microsoft Platform SDK as a 7.9Mb download here). In there is a program called msidb.exe. Its only mission in life is to pack .cabs into .msis, so it’s appropriate for the task. If you’re into esoteric stuff like that, you can check out the full docs here.

1) Put the .cab and the .msi in the same directory as msidb.exe.
2) Open a DOS prompt and navigate to the directory with msidb.exe in it.
3) Run the following command, replacing the defaults with the names of your MSI and CAB files “Msidb.exe -d mydatabase.msi -a mycab.cab
4) In the Media table of your MSI, rename the link to the .cab file with a # sign in front of it. In other words, if your file is called Data1.cab, the Cabinet column of the Media table should now read #Data1.cab.

Your MSI will now look inward to find the files it needs, and after all, isn’t that what world peace is all about?

msi, .msi, .cab, cabinet file, cabinet, stream, stream cabinet, stream .cab, media table, msidb, msidb.exe, windows installer, windows installer sdk, download, active directory, AD, group policy