PDA

View Full Version : I cn't set Target dir and modify it



Doppiapunta
05-04-2004, 05:35 AM
Hi To everybody
i'm making a little Installscript project for installing a my own program.
I'm using Installshield DevStudio 9.
In Project Assistant "Installation Files" i select "Program Files" dir 'cause i want that my program will be installed under "Program Files".
I created under this dir other folders containg all the files i need to install.
I have problems on setting "change default directory feature".
First of all:

1) where can i set the default TARGET DIRECTORY?

And then...

2) I enabled in Project Assistant "Installation Interview Panel" the option called
"Do you want user to be prompted to modify the installation location of your application?"

but even if i enabled this option when installing InstallShield Wizard doesn't ask me to modify the location!
I mean when installing installshield doens't show up any dialog that allows me to modify the install dir! :(

Please help me i tried everything but nothing works!
Probably i made a mistake but i don't know where it is. :(

Thanks a lot

Diego

havard
05-04-2004, 08:30 AM
Hi Diego,
1) Default value of TARGETDIR is usualy set by operator like this :
TARGETDIR = PROGRAMFILES ^ IFX_COMPANY_NAME ^IFX_PRODUCT_NAME; in the OnFirstUIBefore function, you can modify it as you want.
2)When you direct InstallShiel to ask you or not about installation location it just adds or removes comments before dialogs in the setup script :))). So you can do it manually if you need. You have just find in your setup script SdAskDestPath2 function's call in OnFirstUIBefore event handler.
Regards.

Vardan

Doppiapunta
05-04-2004, 11:12 AM
Thanks a lot for your help.
I looked into my OnFirstUIBefore and i found this:



Dlg_SdAskDestPath2:
if ((nResult = BACK) && (nSetupType != CUSTOM)) goto Dlg_SetupType2;
szTitle = "";
szMsg = "";
if (nSetupType = CUSTOM) then
//{{IS_SCRIPT_TAG(Dlg_SdAskDestPath2)
nResult = SdAskDestPath2( szTitle, szMsg, svDir );
//}}IS_SCRIPT_TAG(Dlg_SdAskDestPath2)
TARGETDIR = svDir;
endif;
if (nResult = BACK) goto Dlg_SetupType2;



I don't know what i have to eliminate here.:(
But with this code the window doesn't appear!
I dont know what to do.
I modify the TARGET DIR as you said and i put only:




begin

nSetupType = COMPLETE;

if ( ALLUSERS ) then
TARGETDIR = PROGRAMFILES;
else
TARGETDIR = PROGRAMFILES;
endif;


Is this correct?
Please help me :(
Thanks a lot for your precious help :)

Diego

havard
05-05-2004, 12:43 AM
Hi Diego,
You can see from this code that SdAskDestPath2 shows only during the custom installation. That means you should select Custom from previous dialog (SetupType) or set nSetupType to Custom if you not ask user for setup type.
What about your second question, if I were you, I won't set TARGETDIR = PROGRAMFILES I will use something like this TARGETDIR = PROGRAMFILES ^ "FolderName" to get all my files in one folder. It will be more tidy.

Doppiapunta
05-05-2004, 03:15 AM
Hi Havard
thanks a lot for your reply and for your precious help.
In later yesterday vening i saw that SdAskDeskPat appears only when installation type is CUSTOM so 'cause i don't ask in my installer to select the installation type i resolved by own doing so:




Dlg_SdAskDestPath2:
if ((nResult = BACK) && (nSetupType != CUSTOM)) goto Dlg_SetupType2;
szTitle = "";
szMsg = "";
if (nSetupType != CUSTOM) then
//{{IS_SCRIPT_TAG(Dlg_SdAskDestPath2)
nResult = SdAskDestPath2( szTitle, szMsg, svDir );
//}}IS_SCRIPT_TAG(Dlg_SdAskDestPath2)
TARGETDIR = svDir;
endif;
if (nResult = BACK) goto Dlg_SetupType2;



I so many words i did in another way what yous aid to me..i bypassed that control!
About TARGET DIR question i resolved putting this:

TARGET DIR = "C:\\PROGRAMFILES\\DIEGO'S TOOLS";

i put " "'cause i used a patch with " ' " and now everything works fine ;)

Only another question what can i do to sop showing installation type panel in Installscript MSI installers?

Thanks a lot for your precious help again
See you soon

Diego

havard
05-05-2004, 05:03 AM
If you didn't remove any code from your setup's script you should just open Project Assistant page and select "YES" to the bottom question.
Otherwhise you should add the following code :

Dlg_SdLicense2:
szTitle = "";
szOpt1 = "";
szOpt2 = "";
//{{IS_SCRIPT_TAG(License_File_Path)
szLicenseFile = SUPPORTDIR ^ "license.txt";
//}}IS_SCRIPT_TAG(License_File_Path)
//{{IS_SCRIPT_TAG(Dlg_SdLicense2)
nResult = SdLicense2( szTitle, szOpt1, szOpt2, szLicenseFile, bLicenseAccepted );
//}}IS_SCRIPT_TAG(Dlg_SdLicense2)
if (nResult = BACK) then
goto Dlg_SdWelcome;
else
bLicenseAccepted = TRUE;
endif;

Dlg_SetupType2:[/COLOR]
szTitle = "";
szMsg = "";
//{{IS_SCRIPT_TAG(Dlg_SetupType2)
nResult = SetupType2( szTitle, szMsg, "", nSetupType, 0 );
//}}IS_SCRIPT_TAG(Dlg_SetupType2)
if (nResult = BACK) then
goto Dlg_SdLicense2;
else
nSetupType = nResult;
if (nSetupType != CUSTOM) then
szTargetPath = TARGETDIR;
nvSize = 0;
FeatureCompareSizeRequired( MEDIA, szTargetPath, nvSize );
if (nvSize != 0) then
MessageBox( szSdStr_NotEnoughSpace, WARNING );
goto Dlg_SetupType2;
endif;
endif;
endif;

Dlg_SdAskDestPath2:
if ((nResult = BACK) && (nSetupType != CUSTOM)) [/COLOR]
goto Dlg_SetupType2;
szTitle = "";
szMsg = "";
if (nSetupType = CUSTOM) then
//{{IS_SCRIPT_TAG(Dlg_SdAskDestPath2)
nResult = SdAskDestPath2( szTitle, szMsg, svDir );
//}}IS_SCRIPT_TAG(Dlg_SdAskDestPath2)
TARGETDIR = svDir;
endif;
if (nResult = BACK) goto [/COLOR] Dlg_SetupType2;

Doppiapunta
05-05-2004, 06:36 AM
Thanks a lot Harvard!
You were very kind in helping me.
Well i read your post and i'll follow your istructions!
About the old question i finall resolved deleting "if" funztion and now code is the following:




Dlg_SdAskDestPath2:
if ((nResult = BACK) && (nSetupType != CUSTOM)) goto Dlg_SetupType2;
szTitle = "";
szMsg = "";

nResult = SdAskDestPath2( szTitle, szMsg, svDir );
//}}IS_SCRIPT_TAG(Dlg_SdAskDestPath2)
TARGETDIR = svDir;

if (nResult = BACK) goto Dlg_SetupType2;



...and everything works fine!
Well i need to learn how to rename or to backup old files that will be overwritten by my new ones...in order to allow a rollback if someone wnats to unistall my latest tools.
I'll try...if you know how i'll really appreciate your help!
Thanks a lot again for your kindness and patience.
See you soon
Diego

havard
05-05-2004, 07:22 AM
You're welcome