Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WIX equivalent of a C# textbox?

I'm staring at this page wondering which control is a textbox. Seems like it should be obvious, but I don't see it.

http://wix.sourceforge.net/manual-wix2/wix_xsd_control.htm

Also, is there a built-in "Browse" button to select a file from disk? Or do you have to code all that yourself?

Thanks,

Neal

like image 516
NealWalters Avatar asked Jan 13 '10 15:01

NealWalters


2 Answers

I finally found the textbox (second one below). It was a matter of setting the Type="Edit".

When I was looking at the web page mentioned, I was first looking only at "children" thinking that I would see a textbox there.

<Control Id="Description2" Type="Text" X="135" Y="140" Width="220" Height="20" Transparent="yes" 
    NoPrefix="yes"   Text="Full path to settingsFile:" />
<Control Id="UserSettingsFileName" Type="Edit"
    X="140" Y="150" Width="160" Height="80" Property="SettingsFilename"
    Text="C:\Path\SettingsFileGenerator.xml">

The initial value of the edit/box was not set to the text I specified. Any ideas on that? Do I have to set the property value outside of the control?

But if there is an reasonably easy-to-use "browse"/file-picker, I'd like to know about that too.

like image 162
NealWalters Avatar answered Nov 13 '22 10:11

NealWalters


The wix sources contain a BrowseDlg.wxs file. This file defines the dialog which is used in WixUI_InstallDir to allow the user to enter or browse for the install path, which is exactly the type of functionality you need.

It looks like you just have to use the Type "PathEdit". You also have to give the property where you want the result to be stored, in this case _BrowseProperty:

<Control Id="PathEdit" Type="PathEdit" 
   X="25"
   Y="202"
   Width="320"
   Height="18" 
   Property="_BrowseProperty"
   Indirect="yes" />
like image 42
Wim Coenen Avatar answered Nov 13 '22 11:11

Wim Coenen