cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
AskewDread
Level 4

Different default install paths

Hey guys
how can i have one default install path for xp and another different one for vista?
Labels (1)
0 Kudos
(18) Replies
ChandanOmkar
Level 8

yes its possible.. in install script you have to put the condition. you have to check the OS and then set the INSTALLDIR. here is the pseudo code;

if(version is winXP) then
INSTALLDIR =

else if(version is WinVista) then
INSTALLDIR =
0 Kudos
AskewDread
Level 4

ChandanOmkar wrote:
yes its possible.. in install script you have to put the condition. you have to check the OS and then set the INSTALLDIR. here is the pseudo code;

if(version is winXP) then
INSTALLDIR =

else if(version is WinVista) then
INSTALLDIR =


im very sorry if i sound like a noob but how to i edit that?
0 Kudos
ChandanOmkar
Level 8

use the following piece of code :

if(SYSINFO.nOSMajor >= 6) then
INSTALLDIR = ProgramFilesFolder ^ "VISTA"; // for vista

else if (SYSINFO.nOSMajor >= 5) then
INSTALLDIR = ProgramFilesFolder ^ "XP"; // for xp
endif;

I think this would be helpful for you....
0 Kudos
AskewDread
Level 4

ChandanOmkar wrote:
use the following piece of code :

if(SYSINFO.nOSMajor >= 6) then
INSTALLDIR = ProgramFilesFolder ^ "VISTA"; // for vista

else if (SYSINFO.nOSMajor >= 5) then
INSTALLDIR = ProgramFilesFolder ^ "XP"; // for xp
endif;

I think this would be helpful for you....


thanks for that

its saying
'end' invaliod statement
unexpected end of source file
0 Kudos
ChandanOmkar
Level 8

if(SYSINFO.nOSMajor >= 6) then
INSTALLDIR = ProgramFilesFolder ^ "VISTA"; // for vista

elseif (SYSINFO.nOSMajor >= 5) then
INSTALLDIR = ProgramFilesFolder ^ "XP"; // for xp
endif;


use the above code. There was a space between else and if

Thanks
Chandan
0 Kudos
AskewDread
Level 4

ChandanOmkar wrote:
use the following piece of code :

if(SYSINFO.nOSMajor >= 6) then
INSTALLDIR = ProgramFilesFolder ^ "VISTA"; // for vista

else if (SYSINFO.nOSMajor >= 5) then
INSTALLDIR = ProgramFilesFolder ^ "XP"; // for xp
endif;

I think this would be helpful for you....


ChandanOmkar wrote:
if(SYSINFO.nOSMajor >= 6) then
INSTALLDIR = ProgramFilesFolder ^ "VISTA"; // for vista

elseif (SYSINFO.nOSMajor >= 5) then
INSTALLDIR = ProgramFilesFolder ^ "XP"; // for xp
endif;


use the above code. There was a space between else and if

Thanks
Chandan


hey thanks for that it got rid of the errors 😄 but now its not doing it, it just doesnt apply that change still goes to c:\program files, any ideas?

Thank you sosomuch
0 Kudos
ChandanOmkar
Level 8

put your path in place of ProgramFilesFolder...
did you try this?
0 Kudos
AskewDread
Level 4

AskewDread wrote:
thanks for that

its saying
'end' invaliod statement
unexpected end of source file


ah...hang on i will try that i may of tryed the wrong bit
0 Kudos
AskewDread
Level 4

AskewDread wrote:
ah...hang on i will try that i may of tryed the wrong bit


this is the script i nw have its the entire file does it look right to you?

////////////////////////////////////////////////////////////////////////////////
//
// IIIIIII SSSSSS
// II SS InstallShield (R)
// II SSSSSS (c) 1996-2002, InstallShield Software Corporation
// II SS All rights reserved.
// IIIIIII SSSSSS
//
//
// This template script provides the code necessary to build an entry-point
// function to be called in an InstallScript custom action.
//
//
// File Name: Setup.rul
//
// Description: InstallShield script
//
////////////////////////////////////////////////////////////////////////////////

// Include Ifx.h for built-in InstallScript function prototypes, for Windows
// Installer API function prototypes and constants, and to declare code for
// the OnBegin and OnEnd events.
#include "ifx.h"

// The keyword export identifies MyFunction() as an entry-point function.
// The argument it accepts must be a handle to the Installer database.
export prototype MyFunction(HWND);

// To Do: Declare global variables, define constants, and prototype user-
// defined and DLL functions here.


// To Do: Create a custom action for this entry-point function:
// 1. Right-click on "Custom Actions" in the Sequences/Actions view.
// 2. Select "Custom Action Wizard" from the context menu.
// 3. Proceed through the wizard and give the custom action a unique name.
// 4. Select "Run InstallScript code" for the custom action type, and in
// the next panel select "MyFunction" (or the new name of the entry-
// point function) for the source.
// 5. Click Next, accepting the default selections until the wizard
// creates the custom action.
//
// Once you have made a custom action, you must execute it in your setup by
// inserting it into a sequence or making it the result of a dialog's
// control event.

///////////////////////////////////////////////////////////////////////////////
//
// Function: MyFunction
//
// Purpose: This function will be called by the script engine when
// Windows(TM) Installer executes your custom action (see the "To
// Do," above).
//
///////////////////////////////////////////////////////////////////////////////
function MyFunction(hMSI)
// To Do: Declare local variables.
begin
if(SYSINFO.nOSMajor >= 6) then
INSTALLDIR = "c:\users" ^ "Vista"; // for vista

elseif (SYSINFO.nOSMajor >= 5) then
INSTALLDIR = "c:\program files" ^ "XP"; // for xp
endif;
// To Do: Write script that will be executed when MyFunction is called.

end;
0 Kudos
ChandanOmkar
Level 8

use double slash in place of single slash when giving the path name.
e.g.

if(SYSINFO.nOSMajor >= 6) then
CreateDir("c:\\users\\Vista"); // for vista

elseif (SYSINFO.nOSMajor = 5) then
CreateDir("c:\\program files\\XP"); // for xp
endif;
0 Kudos
AskewDread
Level 4

ChandanOmkar wrote:
use double slash in place of single slash when giving the path name.
e.g.

if(SYSINFO.nOSMajor >= 6) then
CreateDir("c:\\users\\Vista"); // for vista

elseif (SYSINFO.nOSMajor = 5) then
CreateDir("c:\\program files\\XP"); // for xp
endif;


how does that know that its changing the install dir?
0 Kudos
ChandanOmkar
Level 8

Can you upload your whole project so that i can check....
0 Kudos
AskewDread
Level 4

ChandanOmkar wrote:
use double slash in place of single slash when giving the path name.
e.g.

if(SYSINFO.nOSMajor >= 6) then
CreateDir("c:\\users\\Vista"); // for vista

elseif (SYSINFO.nOSMajor = 5) then
CreateDir("c:\\program files\\XP"); // for xp
endif;


have attached the ism file as i assume thats what you want
0 Kudos
ChandanOmkar
Level 8

I am using installshield 2008 and your project is created with some latest version of IS.. so i cant revert back your project file......:(
0 Kudos
AskewDread
Level 4

heres a copy saved as 2008 version, dont write to it as it removed a few things but dont think anything important for this
0 Kudos
AskewDread
Level 4

AskewDread wrote:
heres a copy saved as 2008 version, dont write to it as it removed a few things but dont think anything important for this


any ideas?
0 Kudos
ChandanOmkar
Level 8

I think that putting a browse dialog for destination location is a better solution for this. So that a end user can browse and select the location.

you can pass the default location here as the condition of OS.
0 Kudos
AskewDread
Level 4

AskewDread wrote:
heres a copy saved as 2008 version, dont write to it as it removed a few things but dont think anything important for this


ChandanOmkar wrote:
I think that putting a browse dialog for destination location is a better solution for this. So that a end user can browse and select the location.

you can pass the default location here as the condition of OS.


at the moment it has a thing where people can choose it themselves but our main complaint from people is that its not at least the 2 defaults
0 Kudos