Update Tables in WISE Using VBScript

The WISE application is used to generate installation kits. Using WISE, the user can select files from the local machine and add them to the installation. By adding a file to the installation, WISE saves its location on the local machine.

For example: We want to install an INI file that is located under: C:\Program Files\MyProgram\Ini Files.

What happens if we want to generate an installation, using the same INI file, but taken from other location on the local machine? We would have to enter WISE and manually change the file by selecting it from the new location and compile.

It's easy when there is only one file, but what happens if we have hundreds of files like that?

The example is relevant for developers who develop on a multiple projects environment: We have three projects: AAA, BBB, and CCC. All have the same installations, using the same files, taken from different locations:

The DLLs and EXEs of project AAA are saved under C:\VssWorkingFolder\Projects\Release\AAA.

The DLLs and EXEs of project BBB are saved under C:\VssWorkingFolder\Projects\Release\BBB.

The DLLs and EXEs of project CCC are saved under C:\VssWorkingFolder\Projects\Release\CCC.

Using the manual way, we will have to change the WISE script manually (change the path of all the files) for each project and compile it.

This article shows you an easier way:

  1. Under the 'Setup Editor' tab, under Tables: In the Property table add a row: Property = RELEASE_DIR. Value = C:\.
  2. Under the 'MSI Script' tab, under 'User Interface' tab, search the line containing 'MigrateFeatureStates'. Under this line, add a custom action: 'Call VBScript From Installation'.

  3. In the dialog box, insert the relevant details: for 'Custom Action Name' enter whatever you want. For 'Script File,' enter the name of the VBScript file.

    For 'Script Function Call: enter the name of the function, as written in the VBScript: UpdateProperty.

  4. The script is attached.
  5. In case you wish to convert paths: use the 'Tools > Convert Source Paths' menu option. This dialog displays all the paths of the files that take part in the installation.
  6. Press the 'Change Selected Path' button, and in the 'Change To' edit box, enter the property surrounded with [ ].
  7. Press OK. The 'Convert Source Paths' will display the paths as properties.

Now, to create the installation script for the AAA Project, change the VBScript: C:\VssWorkingFolder\Projects\Release\AAA. To create the installation script for the BBB Project, change the VBScript: C:\VssWorkingFolder\Projects\Release\BBB. To create the installation script for the CCC Project, change the VBScript: C:\VssWorkingFolder\Projects\Release\CCC.

That way, you need to change in only one location. Don't forget to compile the WISE script after changing the VBScript.



Downloads

Comments

  • Change property at compile time

    Posted by OsnatHassner on 08/17/2004 01:03am

    That way is used to changed a property at run time. In case you need to change a property in compile time (so that the .msi files will already contain the ** right ** value), you can use the command line utility of wise, in the following manner: "C:\Program Files\Wise for Windows Installer\WfWI.exe" "C:\VssWorkingFolder\MySetup.wsi" /c /p RELEASE_DIR="C:\VssWorkingFolder\Projects\Release\AAA" /c stands for: compile. /p stands for: property. in this case you've changed the RELEASE_DIR property. next time you'll open the wsi, you'll see that property's value has changed. in the msi that was created in this compilation, the RELEASE_DIR property holds the value "C:\VssWorkingFolder\Projects\Release\AAA" more help is available at the "Wise for Windows Installer" help pages, under "Changing the Source Directory Dynamically During Compile"

    Reply
Leave a Comment
  • Your email address will not be published. All fields are required.

Top White Papers and Webcasts

  • Live Event Date: August 20, 2014 @ 1:00 p.m. ET / 10:00 a.m. PT When you look at natural user interfaces as a developer, it isn't just fun and games. There are some very serious, real-world usage models of how things can help make the world a better place – things like Intel® RealSense™ technology. Check out this upcoming eSeminar and join the panel of experts, both from inside and outside of Intel, as they discuss how natural user interfaces will likely be getting adopted in a wide variety …

  • "Security" is the number one issue holding business leaders back from the cloud. But does the reality match the perception? Keeping data close to home, on premises, makes business and IT leaders feel inherently more secure. But the truth is, cloud solutions can offer companies real, tangible security advantages. Before you assume that on-site is the only way to keep data safe, it's worth taking a comprehensive approach to evaluating risks. Doing so can lead to big benefits.

Most Popular Programming Stories

More for Developers

Latest Developer Headlines

RSS Feeds