This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- How do you set a default value in a Path Edit control
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Mar 28, 2013
07:07 AM
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.
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.
(6) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Mar 28, 2013
09:40 AM
Here is a code fragment which works in my InstallScript MSI project:
"
...
sInstallDir = INSTALLDIR;
nResult = SdAskDestPath( sTitle, sMsg, sInstallDir, 0);
...
"
"
...
sInstallDir = INSTALLDIR;
nResult = SdAskDestPath( sTitle, sMsg, sInstallDir, 0);
...
"
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Mar 28, 2013
09:54 AM
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
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
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Mar 28, 2013
10:36 AM
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.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Mar 28, 2013
12:15 PM
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.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Apr 02, 2013
09:37 AM
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.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Apr 02, 2013
10:32 AM
Okay, if that was what you wanted, you do not have to do 'System Search', Get the value of system property "CommonFilesFolder" instead.