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

Easy question. How I can modify INSTALLDIR in my project

Hi, community.

Easy question. How I can modify "INSTALLDIR" from a dialog windows?
I have downloaded this example here:

http://community.flexerasoftware.com/showthread.php?t=201283


I added to the button "Next" (dialog "InstallWelcome") an additional action, "DoAction" = "DisplayINSTALLDIR"


function DisplayINSTALLDIR(hMSI)
STRING szInstDir;
STRING szInstDir2;
NUMBER nvCount;
INT result;
begin
nvCount = MAX_PATH;

MsiGetProperty(hMSI, "INSTALLDIR", szInstDir, nvCount);;

SprintfBox(INFORMATION, "INSTALLDIR", szInstDir);

szInstDir = "c:\\Projects";

result = MsiSetProperty(hMSI, "INSTALLDIR", szInstDir);

result = MsiGetProperty(hMSI, "INSTALLDIR", szInstDir2, nvCount);

SprintfBox(INFORMATION,"Deferred Execution", szInstDir2);

end;



But, unfortunately, the result is very strange. The MessageBox shows empty value.

So, I think I have some fundamental misunderstanding. Please, help me.

How does it possible to change "INSTALLDIR" value?

The project is attached...
Labels (1)
0 Kudos
(3) Replies
Hazard
Level 4

Some strange things. Now the ShowMessage shows right value.
0 Kudos
jforst
Level 2

Make sure to set nvcount before each call to to MsiGetProperty.
0 Kudos
Hazard
Level 4

I think the problem was with the uncompiled script. It seems that you will debug the script very carefully, always compile it before debugging, because sometimes I saw the values of my constants that were modified before.
0 Kudos