Jon
Jon

Reputation: 1705

Installshield Installscript properties

We have Installshield 2009 for our product. I am trying to muddle my way through it to make some updates (obviously, I am not the original author).

Within, there is a fairly complex arrangement of components and files, plus, there is a script section for some custom work.

I need to accomplish the following, without creating a blank object in the repository.

  1. One of the components needs to create a directory tree (two folders deep).

  2. Within that tree (deepest folder), I need to create a blank file.

Questions:

  1. Do I need to create two components, one for each directory level, or will the tree be created if I specify [INSTALLDIR]folder1\folder2?

  2. I am thinking that the installscript would be the place to create the empty file, based on the CreateFile example in the help. I notice that, in the components page, that, once I typed the value for the Destination property, that a little "tag" of sorts appeared at the start {FOLDER2}. Can I used that tag as an argument to CreateFile and how would I reference it?

Upvotes: 0

Views: 869

Answers (1)

Michael Urman
Michael Urman

Reputation: 15905

Regardless of the project type, I would probably suggest creating the folder structure in the Files and Folders view, and adding the empty file there. It's just simple and you'd be done with fewer chances of error.

As to the questions you asked, neither Basic MSI nor InstallScript projects require components for every folder level on the system. Note that if the folder isn't already there when it executes, the CreateFile approach is unlikely to create the folders for you.

In a Basic MSI project, {FOLDER2} indicates that FOLDER2 is the name of the directory entry, and after CostFinalize there will be a property of the same name that contains its run-time location. You can retrieve it in an InstallScript custom action with MsiGetProperty. In a pure InstallScript project the approach would be a little different, worst case it would be something like TARGETDIR ^ "folder1" ^ "folder2" (my InstallScript is rusty).

Upvotes: 1

Related Questions