Editing the Package

Before editing the package I like to backup the WSI file. (WPS doesn’t backup automatically by default)

Copy Sun_JVM_v1_4_2_03.wsi to Sun_JVM_v1_4_2_03__0.wsi in the same folder. The __0 means raw, fresh from SetupCapture, unedited.

Tip: You can copy the file even if you’ve already started to edit the WSI. As long as you haven’t saved it yet from inside the Windows Installer Editor, the copy will be unedited.


On the Snapshot PC

-Logon as local Administrator.

-Launch Wise Package Studio

-In the Workbench, click Projects tab

-Select the Sun_JVM_v1_4_2_03 Project that we setup

-Click on Run beside Edit package to launch Windows Installer Editor


In Installation Expert view, Project Definition tab:

In Add/Remove Programs node

-click Browse and use the JavaCup.ico file to display.

(Hint: C:\Program Files\java\j2re1.4.2_03\javaws\)

Frame4


In Files node, change the following:

(Hint: in the top portion are your Snapshot PC’s files, the bottom are your pkg’s)


In Registry node, change the following:

(Hint: In the top portion is your Snapshot PC’s registry, the bottom is your pkg’s)

-Browse to HKLM\Software\Microsoft\Direct3D

Notice the MostRecentApplication key(s). In this case the key is used to track what application was the last one to use Direct3D and DirectDraw on the Snapshot PC. (This case it was Javaw.exe) Do we really need to stamp this on every machine out there? It will be changed every time a different application uses Direct3D or DirectDraw. Therefore it is junk and we delete both MostRecentApplication keys from the package.


[HKCU\Software\Microsoft\Windows\CurrentVersion\Controls Folder]

"Presentation Cache"

This is another moving target. A cache of anything is usually different on each machine. So we delete it. (I also tried to keep this in the package in a previous attempt and it prevented the package from installing)


[HKCU\SessionInformation]

"ProgramCount"

This is the number of applications running (in XP) during the SetupCapture. And of course this is a moving target and has to go. For some reason Wise hasn't added this to their default exclusion list.



Now we want to make sure that this package will be installed so that all users, current and future, will have the changes done to their profile. To cause this we use the ALLUSERS property.


-In Setup Editor view, Products tab

In Properties node

-Right-click and select New -> Property

-Add ALLUSERS=1 as shown below and click OK


Because ALLUSERS is a predefined property we get this warning.

Just ignore it and click OK


Now we do a search for the “Infamous [! Vs. [# Wise encoding bug”.

-In Setup Editor view, Tables tab

-Press Ctrl-F and enter [!

It seems that since I did not use the SmartMonitor feature, I didn’t find any instances of [!

For this tutorial I originally had SmartMonitor enabled and this is what I got instead.

Initial testing

This is just to see if we have a package that compiles or not.

While still on the Snapshot PC,

-Click on the Compile button (at the bottom)

-the MSI is now being compiled to:

W:\WiseSharePoint\Projects\Sun_JVM_v1_4_2_03\Sun_JVM_v1_4_2_03.msi

Switch to the Testing PC

Leaving the Snapshot PC alone, we switch to the Testing PC to see if we have a working package or not.

-Logon as local Administrator

-Browse to the SharePoint and install Sun_JVM_v1_4_2_03.msi

Because this is a plug-in we must now find some content on the Internet to use it.

Sun helps out by providing their Java Showcase at:

http://java.sun.com/getjava/showcase.html

Out of the links, I chose this one because it only runs with Sun’s Java JVM, not MS’: http://www.nascar.com/races/pitcommand/demo/

and click the Launch Demo button

-Accept the Security Certificate and wait about 5-10 seconds

Editing the Package, again

I don’t know if you noticed but our package is, er, a little on the bloated side. We started with a 14.5MB exe file and we end up with a 33.7MB MSI file! Why? The original installation process left a bunch of installation files. Usually this isn’t the case. Most installers deleted their temporary files. (This one didn’t because Sun wants the Java runtime to be able to DL updates. Here they just left the installation files around. Since the Java will be launched by Restricted Users (aka Limited Users in XP) they can't install it. We will want to rip this out to save storage and bandwidth. )


Since we have a working package make a backup of it.

Copy Sun_JVM_v1_4_2_03.wsi to

Sun_JVM_v1_4_2_03__1.wsi

Or even

Sun_JVM_v1_4_2_03__1_works_but_bloated.wsi in the same folder.


On the Snapshot PC, in WPS

-In Installation Expert view,

-In Files node, browse to:

\Program Files\Common Files\Java\Update\Base Images\j2re1.4.2-b28

-You’ll notice that there are 4 ZIP files and in the folder below is the install engine. We’re using MSI to install file so we don’t need them anymore. Delete them.

Frame7


-Now let’s look for more junk. To speed up the hunt, right-click on any folder and select Hide Empty Folders

-Browse to:

\Windows\Profiles\Application Data\{7148F0A6-6813-11D6-A77B-00B0D0142030}

-You’ll notice that there is an MSI and an MST file. Why are they there? Sun’s original exe was in fact a proprietary installer within an MSI within an EXE. This is just leftovers from Sun’s installation process, just like the ZIP files above.

-Click on the Compile button (at the bottom)

-The MSI is now being compiled to:

W:\WiseSharePoint\Projects\Sun_JVM_v1_4_2_03\Sun_JVM_v1_4_2_03.msi


Second test

Re-image the Testing PC to prevent leftovers from the previous test.

Switch to the Testing PC

-Logon as local Administrator

-Browse to the SharePoint and install Sun_JVM_v1_4_2_03.msi

Because this is a plug-in we must now find some content on the internet to use it.

Sun helps out by providing their Java Showcase at:

http://java.sun.com/getjava/showcase.html

Out of the links, I chose this one because it only runs with Sun’s Java JVM, not MS’: http://www.nascar.com/races/pitcommand/demo/

and click the Launch Demo button


-Accept the Security Certificate

-And wait about 5-10 seconds

Again for me, this works just fine.