cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Balaji_Vinu
Level 5

Getting the URL Correct.

Hi Folks,
I have given a end user an option to change the location of the application.

I use the file(Balaji,txt) that is present under the Application Files during the installation process. But I have Hardcoded the value (link or url) in my installscript as below

For eg:
strFileName = "C:\\InstallShield 2009 Projects\\CBW\\PROJECT_ASSISTANT\\SINGLE_EXE_IMAGE\\DiskImages\\DISK1\\program files\\Infy\\Test\\Deploy\\Balaji.txt";

But when user selects different location , the code fails saying not able to locate the file. How can this be corrected.

How can i dynamically change the URL in the installscript according to users choice.
Labels (1)
0 Kudos
(8) Replies
RobertDickau
Flexera Alumni

If it's a file that you're installing, perhaps something like INSTALLDIR^"filename.txt" would do it?
0 Kudos
Balaji_Vinu
Level 5

Hi Robert,
I tried out this option but not worked out well in my case.

I have added the required file that needs to be called in the installscript, under Application Files in Project Assitant TAB.

But when end user goes for installation the script is called before the application is installed in the end user meachine (i.e During Installation process). The text file should be present in the database in my local where i have got installshield installed. But in the end user perspective how can i dynamically call the file that is present under the Application Files during installation in end user meachine. (While running the exe).

So how can i dynamically use the path (URL) in my InstallScript.

I am having a compressed form of setup.exe file which will be used by the end user for installing the application in his local meachine.
0 Kudos
RobertDickau
Flexera Alumni

For files you want to use during installation but not necessarily install, perhaps look into the Support Files view and the SUPPORTDIR property or variable (depending on project type)?
0 Kudos
Balaji_Vinu
Level 5

Hi Robert,

I have tried according to the topic in the help document.
Placing Files in the .msi Database and Extracting Them During Run Time

First i have added the text file (Balji.txt) under the Support Files option. Then i added in the script to call the txt file during installation as strFileName = SUPPORTDIR^"Balaji.txt";

And for setting the propert i used the code

if(MsiGetProperty(hMSI, "DisplaySupportDir", supportDirPath, supportDirPathBuffer) == ERROR_SUCCESS) then

SprintfBox(INFORMATION,"Deferred Execution","The value of SUPPORTDIR is %s",supportDirPath);

SprintfBox(INFORMATION,"Deferred Execution","The value of InstallScript's SUPPORTDIR is %s",SUPPORTDIR);

endif;


I am not able to see any Balaji.txt file when installation process started. Still getting the error message file missing.
0 Kudos
RobertDickau
Flexera Alumni

Sorry, what is DisplaySupportDir? (A first thing to check is, have you set a large enough value in your supportDirPathBuffer variable before calling MsiGetProperty?)
0 Kudos
Balaji_Vinu
Level 5

Robert,

I have added the following code in the installscript function DisplaySupportDir

supportDirPathBuffer = MAX_PATH;

if(MsiGetProperty(hMSI, "CustomActionData", supportDirPath, supportDirPathBuffer) == ERROR_SUCCESS) then

SprintfBox(INFORMATION,"Deferred Execution","The value of SUPPORTDIR is %s",supportDirPath);

SprintfBox(INFORMATION,"Deferred Execution","The value of InstallScript's SUPPORTDIR is %s",SUPPORTDIR);

endif;

During installation, I noticed two folder were created in user TempFolder. The first folder always consistent and named with {ProductCode}, and also all the files i put in support files is here. The second folder name always dynamic, and it contains files like "_isres.dll, IsConfig.ini, ISRT.dll, setup.inx ..."

Usually the SUPPORTDIR should be the temp folder named with the {ProductCode}? If yes, i would rather point to "TempFolder\{ProductCode} to access my files for installation.

But the SUPPORTDIR is pointing to the folder which has files like "_isres.dll, IsConfig.ini, ISRT.dll, setup.inx ..." .. But the file i put in support files is present in folder {ProductCode}.

What should be done in this case?
0 Kudos
RobertDickau
Flexera Alumni

I believe you'll want the SUPPORTDIR property, and not the SUPPORTDIR variable; the "SUPPORTDIR" help topic has some more information.
0 Kudos
Balaji_Vinu
Level 5

Robert,

Its perfect it worked out really well, Thanks for your help.

using "SUPPORTDIR" Variable

if(MsiGetProperty(hMSI, "SUPPORTDIR", supportDirPath, supportDirPathBuffer) == ERROR_SUCCESS) then
MessageBox(supportDirPath,0);
endif;

strFileName = supportDirPath^"Balaji.txt";
0 Kudos