Menu

Creating_Configuration_files_during_installation.

snarfle

Many programs use a configuration file to control behavior. In particular, if you are going to be using LUP to manage updates, it might make sense to disable the automatic updates built in to the products. It would be useful for the update to create the necessary configuration file (mms.cfg for Flash, deployment.properties for Java, etc).

One way to get that file created as part of the update would be to use a vbscript to write the desired contents to the file. The steps below (loosely adapted from <http://www.spinnersoftware.com/kb/en/msi/customactions.html>) describe how to execute a vbscript as part of the update.

  • Open your MSI file with ORCA.
  • Select Transform/New transform.
  • In the Binary table, go to right pane and select 'Add Row' from the context menu. Use the following parameters to populate the row:
    • Name: TestVbs
    • Data: drive:\path\test.vbs
  • In the CustomActions table, go to right pane and select 'Add Row' from the context menu. Use the following parameters to populate the row:
    • Action=RunTestVbs
    • Type=6
    • Source=TestVbs
    • Target=NULL (leave blank)
  • In the InstallExecuteSequence table, go to right pane and select 'Add Row' from the context menu. Use the following parameters to populate the row:
    • Action=RunTestVbs
    • Condition=NOT Installed
    • Sequence=6500 (Should be a number just below the InstallFinalize action, which is commonly 6600)
  • Use Transform/Generate Transform to save an MST file.

The vbscript might look something like this:

' This is a sample script showing how to create an MMS.CFG file.  It
' is intended to be added to an MST for installing Adobe Flash

' Note: It only works on x86 machines.

Const ForWriting = 2
dim wshShell, objFSO, objTextFile, sFileName, sArchitecture

Set wshShell = CreateObject( "WScript.Shell" )
sArchitecture = wshShell.ExpandEnvironmentStrings("%PROCESSOR_ARCHITECTURE%")

' This script only works on x86
if sArchitecture = "x86" then

   Set objFSO = CreateObject("Scripting.FileSystemObject")

   ' mms.cfg gets written here
   sFileName = wshShell.ExpandEnvironmentStrings("%windir%\System32\Macromed")

   ' Ignore folder create errors on the assumption the folder already exists
   on error resume next
   objFSO.CreateFolder(sFileName)

   sFileName = sFileName & "\Flash"
   objFSO.CreateFolder(sFileName)

   on error goto 0
   sFileName = sFileName & "\mms.cfg"

   ' Overwrite any existing file
   Set objTextFile = objFSO.OpenTextFile (sFileName, ForWriting, True)

   ' Write the configuration settings
   objTextFile.WriteLine("AutoUpdateDisable=1")

   objTextFile.Close
end if

After you have executed these steps, you need to use the Add File button when creating the update to add the MST file to the update. Note that you do NOT need to include the VBS file, since it is embedded in the MST file.


Related

Wiki: Creating_WSUS_updates_for_Adobe_Flash_(v10.1)
Wiki: Creating_WSUS_updates_for_Java

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.