Jump to content


This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Photo

Mererge Module to install a file based on property


1 reply to this topic

RayKode

RayKode
  • Full Members
  • 58 posts

Posted 14 February 2008 - 16:25

Hello everyone.

IS 2008.

I have an existing basic .msi project (I inherited it.) that consumes 40 or so merge modules.

Some of these merge modules install files into Windows System32 and the rest install files into the same destination folder based on what feature is chosen.
Everythings works great.

I have been asked to install one file into a different folder on the pc.
I have been asked to display a dialog which gives the suggested location and then allow the installer to choose where to install the file if He\She doesen't want it in the suggested location.

The suggested location is a value in the registry.

Here's what I want to do.

Create a merge module that installs this one file.

Then in my MSI
Created a public property, let's call it "RAY".
Then during the APP Search I populate it with the registry value refered to above.
I then display a dialog which indictes where the user may want to install the file("RAY") but give the user the ability to change the location("RAY").

How do I get my Merge Module to install the file into the destination folder that is in the public property named "RAY" ?

I've tried several combinations of things on my own but have not been sucessfull.
(I've never done this before.)

Based on my description above, how SHOULD I configure the MM and the MSI so the Merge Module uses the value that will be set in the "RAY" public property ?

Thanks for any and all responses.

KathyMorey

KathyMorey
  • Full Members
  • 111 posts

Posted 15 February 2008 - 15:03

I know of two ways to do this, not sure which is the better one...

METHOD 1
In your merge module,
1. Set the file to install to INSTALLDIR.

2. Create a Set a Directory custom action to set the merge module's INSTALLDIR to [RAY].

3. In the Direct Editor, in the ModuleInstallUISequence and/or ModuleInstallExecuteSequence tables, schedule the custom action to run after CostFinalize.

4. Check the CustomAction table to make sure that you are setting the "decorated" INSTALLDIR (INSTALLDIR.guid) to the "undecorated" RAY (RAY, not RAY.guid)

In your main project,
1. Make sure the RAY property is set before CostInitialize.

METHOD 2
In your merge module,
1. Set the file to install to INSTALLDIR.

In your main project
2. Create a directory called "RAY" with a default value

3. When you add the merge module to the project, right click and select properties

4. Select the "RAY" directory as the install location

5. Set the "RAY" directory to the proper value before CostInitialize.
Kathy Morey
Synergy Software Engineer
ProfitStars, a Jack Henry Company
kmorey@profitstars.com