cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
MarcinH
Level 2

Destination folders - can be changed?

Hi, I have a question about destination computer's folders (from page APPLICATION DATA in INSTALLATION DESIGNER view). Is it possible to change default destinations of these folders? It's important for me because I want make one project IS for Vista and XP.
Example: I put some files into [AppDataFolder]. And now if I install my program on Vista system I want use default predefined path for [AppDataFolder] (set at run time by the installer). But if I will install on XP I don't want using defaulf predefined path but chage it for example to "C:\New localization\new directory".

Some pseudocode:
[CODE]
...
if (system==XP)
{
[AppDataFolder]="C:\New localization\new directory"
}
else // (on VISTA)
{
// do nothing --> [AppDataFolder]=default predefined VISTA directory
}
// install files to right folder depend on OS
...
[/CODE]

Theoretically can I do something like above?
Labels (1)
0 Kudos

(3) Replies
ma1achai
Level 3

Should be fine... I know I set the TARGETDIR manually at runtime using a simple:

TARGETDIR = "C:\bleh\";


My project might be different, though, as it is an InstallScript project instead of msi...

-putman;
0 Kudos
MarcinH
Level 2

TARGETDIR - yes, but for example AppDataFolder - no. When I try manually change AppDataFolder I received error C8012 (semicolor expected). I've found in help this sentence: "This system variable is read-only; if you attempt to assign a value to it, a compiler error will result." So now I think I cannot modify default predefined folders.
0 Kudos
Nicolasb
Level 5

Hi,

You can try creating a directory variable, say MyAppDataFolder. By default, MyAppDataFolder = [AppDataFolder]. Then, you create a SetDirectory custom action to overwrite MyAppDataFolder and set it to your Xp folder. Define that custom action to be executed only if the OS is Xp. Execute that custom action after cost finalize in both UI and Exec sequence.

I'm pretty sure that will work since I did something similar in my project. Good luck.
0 Kudos