MSI Packaging of Java Runtime 1.7


In this post I will contribute on how I make a good MSI package to deploy to my customers.

When there is a new version released, I will navigate to in Internet Explorer. Then I push on “Free Java Download”. Push the link “See all Java Downloads”. You could also use this link:

Download “Windows x86 Offline” and save it in a temporary folder, like on the Desktop.

Execute the downloaded Exe-file and stop when the installation window pops up.

Open the folder “%appdata%\..\LocalLow\Sun\Java”

Copy the folder of the version of Java that you want to deploy, like in my case “jre1.7.0_45″

When the copy is done you can close the installation you had started.

In the folder you copied, you will have a Cab-file, a MSI-file and a MST-file. The rest of the files you can remove.

Rename the MST file 10XX.mst to Silent.mst

Open the MST file in InstallShield.

  • Under Additional Tools > Direct Editor
  • Open the table Property
  • Change JAVAUPDATE to 0
  • Change JU to 0


If you want to uninstall Java 1.6

  • Add to SecureCustomProperties:  ;OLDPRODUCTS
  • Open the table Upgrade
  • Add a new Row:
    • UpgradeCode: {57BDA5C6-443C-4D65-B233-2823932160FF}
    • VersionMin: 0
    • VersionMax:
    • Language:
    • Attribut: 512
    • Remove: ALL
    • ActionProperty: OLDPRODUCTS
  • Open the table InstallExecuteSequence
  • Add to RemoveExistingProducts:  Or OLDPRODUCTS


  • Open Behavior and Logic > Custom Actions and Sequences
  • Rightclick on “Custom Actions” and choose “New EXE > Path referencing a directory”
  • Use these values:
    • Name: CloseRunningApps
    • Working Directory: SystemFolder
    • Command Line: taskkill.exe /F /IM iexplore.exe /IM jqs.exe /IM firefox.exe /IM java.exe /IM javaw.exe /IM javaws.exe
    • Change “Return Processing” to “Synchronous (Ignores Exit Code)”
    • Change “Install Exec Sequence” to “After CostFinalize”.
  • Rightclick on “Custom Actions” and choose “New EXE > Path referencing a directory”
  • Use these values:
    • Name: DeleteShortcuts
    • Working Directory: SystemFolder
    • Command Line:

cmd.exe /C rmdir “%PROGRAMDATA%\Microsoft\Windows\Start Menu\Programs\Java” /S /Q

  • Change “Return Processing” to “Synchronous (Ignores Exit Code)”
  • Change “Install Exec Sequence” to “After InstallFinalize”
  • Change “Install Exec Condition” to “NOT INSTALLED” so it only executes during installation.
  • Open System Configuration > Registry
    • Choose the component jz
    • Create HKEY_LOCAL_MACHINE\Software\JavaSoft\Java Update\Policy
      • Create REG_DWORD EnableAutoUpdateCheck with the value 0
      • Create REG_DWORD EnableJavaUpdate with value 0
    • Create HKEY_LOCAL_MACHINE\Software\JavaSoft\Auto Update
      • Create REG_SZ AUVersion with no value/data
  • Open Organization > Setup Design
    • Create a new Feature named CompanySettings
    • Make it requiered and not visible
  • Open Application Data > Files and Folders
    • Choose your feature in the list (CompanySettings)
    • Create a new folder under[ProgramFilesFolder]\Java\jre7 named lib
    • Add your file to that lib folder. Choose to add the file “In a new CAB file”
    • Make to a Key File by rightclick on it and choose Key File

Sample of


The should be in the lib folder or in a subfolder to the Windows directory. The user will then inherit these settings.

Save your MST file. The installation is now ready for testing. As a test I will create a silent.bat in the same folder with this content:

msiexec.exe /I “%~dp0jre1.7.0_45.msi” /qb REBOOT=ReallySuppress TRANSFORMS=”%~dp0Silent.mst”

Some of the key points in this package is that I close running process to avoid computer restarts and I create a registry key that usually is missing and causing the Java Control Panel app to not start and I add a file that will suppress the check for Expired releases and causing popups to be displayed for the end user.

This entry was posted in Application Packaging, Customization, Scripting. Bookmark the permalink.
Add Comment Register

Leave a Reply

Your email address will not be published. Required fields are marked *


three + 6 =

* Copy This Password *

* Type Or Paste Password Here *

8,634 Spam Comments Blocked so far by Spam Free Wordpress

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>