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

How do you set a default value in a Path Edit control

Hi
I have created a dialog with PathEdit, DirectoryList and DirectoryCombo controls.

I have assigned/created the Property SV_FOLDER to all 3 controls.

I have added SV_FOLDER as a public property in the property manager.

In the Property Manager if i give SV_FOLDER the value C:\ everything works fine, in my dialog the start value is C:\ and I can browse and select a folder and the property SV_FOLDER is correctly set to the folder ive selected once i exit the dialog.

However I can't assume C:\ is a valid drive, so i need to set the default to be a variable such as INSTALLDIR.

In the Property Manager Ive tried setting SV_FOLDER to have the value INSTALLDIR and this appeared to work but what actually happened was the property INSTALLDIR was set to whatever folder I browsed to and SV_FOLDER was set to the string INSTALLDIR.

All i need to know is how to set a default value for the Property in my PathEdit control that is based on another property such as INSTALLDIR? Its driving me nuts.

Thanks in advance for any help or advice.
Labels (1)
0 Kudos
(6) Replies
OldBean
Level 5

Here is a code fragment which works in my InstallScript MSI project:
"
...
sInstallDir = INSTALLDIR;
nResult = SdAskDestPath( sTitle, sMsg, sInstallDir, 0);
...
"
0 Kudos
SeanSteele
Level 4

Hi

Thanks for your help, I totally forgot to say that my project is a Basic MSI project so I'm not using Installscript.

I'm sure I must be missing something obvious but have no idea what it is
0 Kudos
OldBean
Level 5

IC, not sure if this helps, but have you explored the options in Custom Actions "Set Property" and "Set Directory"? putting the CAs in certain places might yield what you wish for.
0 Kudos
SeanSteele
Level 4

Thanks Oldbean, I'll investigate, Ive not had to write a Custom action before (Ive been mainly an Installscript kind of guy) so was hoping to avoid it if I could but thanks and I'll let you know if I manage to solve my problem.
0 Kudos
SeanSteele
Level 4

OldBean wrote:
IC, not sure if this helps, but have you explored the options in Custom Actions "Set Property" and "Set Directory"? putting the CAs in certain places might yield what you wish for.


Hello OldBean
What Ive ended up doing is adding a 'System Search' to look for the folder '[ProgramFilesFolder]\Common Files' and then set this to the default value of my Property SV_FOLDER and it all seems to work ok.

I'm pretty sure there will always be a '[ProgramFilesFolder]\Common Files' folder on the system.

Thanks for replying to my post.
0 Kudos
OldBean
Level 5

Okay, if that was what you wanted, you do not have to do 'System Search', Get the value of system property "CommonFilesFolder" instead.
0 Kudos