PDA

View Full Version : Mystery Drive letter


deanjo
08-21-2005, 08:42 PM
I just don't understand whats happening here.

Every time I add something like this:

Registry.SetValue(HKEY_CURRENT_USER, "Software\\Testrun\\Today", "AppDir", SessionVar.Expand("%AppDrive%%AppFolder%"), REG_SZ);

And then I go to install the app and change the drive location I get registry entry like this:

c:f:\some directory\

Where the heck is that c: coming from?

bnkrazy
08-22-2005, 10:52 AM
%AppDrive% returns the drive letter of the %AppFolder% variable, so it is unnecessary in this case. Simply remove the %AppDrive% as the drive letter is included with the %AppFolder% variable. %AppFolder% returns by default %ProgramFilesFolder% and %ProductName%. See the Session Variables tab of the Project Settings dialog to customize.

From the help file:

%AppDrive%
The drive letter of %AppFolder%. You should not set this variable explicitly. It is reset every time that %AppFolder% is re-assigned. For example, if %AppFolder% is C:\Program Files\My Program, %AppDrive% will be C:.

Adam
08-23-2005, 11:51 AM
It looks like %AppDrive% is not being updated when %AppFolder% is changed from the default. This will be fixed for the next service release.

If you need %AppDirve% then you can use this script to correct the issue:


AppFolderPieces = String.SplitPath(SessionVar.Expand("%AppFolder%"));
SessionVar.Set("%AppDrive%",AppFolderPieces.Drive);


Adam.