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

Can't change install location


5 replies to this topic

Anthony Hughes

Anthony Hughes
  • Members
  • 30 posts

Posted 20 August 2001 - 15:32

I'm installing a bunch of sample files with my application to the Common Documents shell folder if it exists, but I'd like the user to be able to change this at install time if they wish.

I've created a SAMPLEDIR in the directory table, and Im using a CA to run some script that uses the ShGetFolderPath API to initialise it.

I then set the destination of my samples feature to [SAMPLEDIR]

Everything works as expected - the default location is evaluated and displayed in the custom setup dialog correctly.

HOWEVER if you select Change.. and browse some where else for the destination, the files STILL get installed in the Common Documents folder.

What's going on? I'm tearing out what little hair I have left.....

Anthony


Anthony Hughes

Anthony Hughes
  • Members
  • 30 posts

Posted 23 August 2001 - 09:17

Ok, as a followup to getting nowhere I created a new test project.

It has 2 files, one .exe and one .jpg - in 2 features in 2 components.

I set the destination for the .exe feature/component as [INSTALLDIR] and the destination for the .jpg feature/component as [CommonFilesFolder]

When I run the install, choose the Custom dialog and select a new location for the .jpg feature, it STILL installs to CommonFilesFolder

How do I get it to install to the new location I specified ????


Ian Blake

Ian Blake
  • Members
  • 483 posts

Posted 23 August 2001 - 09:42

CommonFileFolder is a special folder is given its value on the client and server side so any change you make in the UI sequence is changed back in the execute sequence.

I suggest you create a new entry in the directory table initially derived from commonfiles.  

eg.

Directory:  SHARED
Directory_Parent:  CommonFilesFolder
DefaultDir:   .:Shared~1|SharedFiles

use [SHARED] as the directory for the components you are sending to common files.  You should be able to change SHARED.

I have never tried this but it looks like a way ahead.

Remember there is a destination field in feature and component tables.

(Edited by Ian Blake at 9:51 am on Aug. 23, 2001)


Anthony Hughes

Anthony Hughes
  • Members
  • 30 posts

Posted 23 August 2001 - 10:40

Ah! Bingo!

Many thanks Ian - that seems to be it. Out of interest where does the DefaultDir value come from and what does it mean?

Cheers
Anthony


Ian Blake

Ian Blake
  • Members
  • 483 posts

Posted 23 August 2001 - 12:11

The DefaultDir field defines what the directory will be called on the target media and source media.

The simplest form is simply
Name
This will use a directory called Name on the target and the source.

The next level of complication is with long names
ALongN~1|ALongName
This defines an alternative short name

The next level allows you define seperate names for the target and the source media.
Target~1|Target DIrectory:Source~1|SourceDirectory
In this case the name (or long short pair) before the colon define the name of the target directory and the name after the colon defines the source directory name.

Finally a special name . (full stop) is defined that means no name use the parent directory.

This is usually used when you have two files with the same name that are installed for different languages or different  operating systems. In this case seperate msi directories are created with the same parent but different DefaultDirs eg.
.:NTFiles
.:9XFiles
You will have components with conditions for choosing the operating system and using the appropriate directory.  The install bulder place the files in 9XFiles and NTFiles respectively but when they are installed they will be placed in the parent directory.

If you want see the source directory structure and you are using cabs do an admin install
msiexec /a YourProject.msi
this will unpack the install to your network or local drive so that you can see the structure.  

In the example I gave earlier the files intended for the commonfilesfolder will be placed in a directory called SharedFiles.

Hope this explanation helps you understand.  If you want to know more look at the Msi documentation for the Directory Table.
Windows Installer
  Installer Database
     Installer Database Reference
        Database Tables
           Directory Table