WIX installer - pass variable to the next window - installation

I'm trying to implement the next scenario:
'Welcome dialog' -> 'Service name dialog' -> 'Installation path dialog'
Service name dialog is a custom one. User is supposed to input the name of the service and after pressing 'Next' button - at the 'Installation path dialog' shoul appear default path like ".....\inserted_value_on_previous_window".
At 'Service name dialog' I have Edit Control implemented like:
<Control Id="ServiceValueEdit" Type="Edit" X="15" Y="60" Width="200" Height="15" Property="WIXUI_SELECTEDSERVICENAME" Indirect="yes" />
So it is supposed to set WIXUI_SELECTEDSERVICENAME property.
For setting default installation path at 'Installation path dialog' I use code like:
<Property Id="WIXUI_SELECTEDSERVICENAME" Value="SELECTEDSERVICENAME"></Property>
<Property Id="WIXUI_INSTALLDIR" Value="INSTALLDIR"></Property>
<SetDirectory Id="INSTALLDIR" Value="[DEFIISFOLDER]\[WIXUI_SELECTEDSERVICENAME]" Sequence="both"></SetDirectory>
But, unfortunately, when we go to 'Servic name dialog' and set any value - it does not get reflected on the next screen. The next window will alvays have default value SELECTEDSERVICENAME. What I think it gets set just one at the compilation time and does not get updated during the runtime.
Can anyone help to fugure out how it is possible to get this value be set from one window and being ransferred to the next one?
Thank you.
To be clear here are the couple of screenshots:
So what I want to do is to make the dialog below this string contain 'name' (as shown on the picture abowe) instead of 'SELECTEDSERVICENAME' as listed below.

You are setting the value of INSTALLDIR to [DEFIISFOLDER][WIXUI_SELECTEDSERVICENAME] during the initial setup of the install. That means you are using the initial value of WIXUI_SELECTEDSERVICENAME when setting the INSTALLDIR property.
You need to publish an event when you switch UI pages which will update the installdir.
I think something similar to:
<Control Id="Next" Type="PushButton" X="236" Y="243" Width="56" Height="17" Default="yes" Text="!(loc.WixUINext)" />
<Publish Property="INSTALLDIR" Value="[DEFIISFOLDER]\[WIXUI_SELECTEDSERVICENAME]">1</Publish>
</Control>
would update the INSTALLDIR property with the new WIXUI_SELECTEDSERVICENAME value.

Related

New Property in udm.DeploymentPackage as disabled in xldeploy

XLDeploy allows its CI to be extended by adding entry in synthetic.xml.
i modified synthetic.xml and added a new property:
<type-modification type="udm.DeploymentPackage">
<property name="notes" kind="string"/>
i can see this property on UI now:
However i want this field to be Disabled or Readonly. Can i?
Read-only field in a CI feature is not implemented yet .. what you can do if you're not going to change it during deployment is to define a hidden field with a default value.
<type-modification type="udm.DeploymentPackage">
<property name="notes" kind="string" default="My Custom Notes" hidden="true"/>
If you want this to be visible then you will need to define 2 properties one visible and another hidden.
The visible would be a display text field.
The hidden would be what is actually used.
You can then make sure the description is clear that even if a user changes this value, it will remain at the default.
<type-modification type="udm.DeploymentPackage">
<property name="hiddenNotes" kind="string" default="My Custom Notes" hidden="true"/>
<property name="notes" kind="string" default="My Custom Notes" hidden="false" description="Changing this will not affect actual value, it will remain at the default"/>

Creating visual studio extensions for table nodes in the Server Explorer Data Connections

I would like to add a custom command to the context menu of each node that appears for every table in a sql server database listed in the Server Explorer.
I've gone through a basic tutorial and added a command to the tools menu bar as well as a custom top level menu.
I've also seen the tutorial Extending the Server Explorer to Display Web Parts which is very close to what I want to do, but it is specific to the sharepoint connections node, and uses the sharepoint specific IExplorerNodeTypeExtension interfaces. I'm having trouble finding any documentation pertaining to the data connections node. Can anyone provide any references to relevant documentation or information on what interfaces I should be leveraging?
With some hints from Jack Zhai and a few other web resources I was able to track down information.
Stack Overflow - Context menu for Server Explorer
MSDN blog - How to add custom menu to vs editor window
MSDN Blog - Using EnableVSIPLogging to identify menus and commands with VS 2005
So first, I enabled VSIPLogging by setting the EnableVSIPLogging to 1 in Computer\HKEY_CURRENT_USER\SOFTWARE\Microsoft\VisualStudio###\General
Then I was able to determine what the guids and ids of any menu item or tree node in Visual Studio by holding down CTRL + SHIFT and right clicking on it.
From this I was able to determine that the top level nodes in the server explorer had a Guid of {74D21310-2AEE-11D1-8BFB-00A0C90F26F7} with a command id of 1283.
Object nodes in the server explorer (such as Tables, stored procedures, etc) have a Guid of {d4f02a6a-c5ae-4bf2-938d-f1625bdca0e2} and a command id of 33280 (0x8200)
Object node parents in the server explorer (such as the static "Tables", "Stored procedures", nodes that categorize the object nodes) have a guid of {d4f02a6a-c5ae-4bf2-938d-f1625bdca0e2} and a command id of 33024 (0x8100)
So with these Guids I can now attach my commands where I want.
I want a command that is specific to an individual table, and a command that is specific to all tables in the database so I will use a d4f02a6a-c5ae-4bf2-938d-f1625bdca0e2 with command id of 0x8200 and a Guid of d4f02a6a-c5ae-4bf2-938d-f1625bdca0e2 with command id of 0x8100.
Next I need to define these values in my vsct file of my VSIX project so I add them to the symbols section:
I add 2 command items to my project and then I need to change the parent of the groups so they appear on the correct area in the server explorer:
Now, the database command does appear for all static object nodes, even though I want it to only appear on the "Tables" node, and the table command appears for all object nodes and their, even though I want it to appear only for the table node itself. I believe that needs to be solved in code somehow, dynamically determining the visibility of the command menu item, but I'll have to figure that one one separately.
Below is the vsct in its entirety:
<?xml version="1.0" encoding="utf-8"?>
<CommandTable xmlns="http://schemas.microsoft.com/VisualStudio/2005-10-18/CommandTable" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<!-- This is the file that defines the actual layout and type of the commands.
It is divided in different sections (e.g. command definition, command
placement, ...), with each defining a specific set of properties.
See the comment before each section for more details about how to
use it. -->
<!-- The VSCT compiler (the tool that translates this file into the binary
format that VisualStudio will consume) has the ability to run a preprocessor
on the vsct file; this preprocessor is (usually) the C++ preprocessor, so
it is possible to define includes and macros with the same syntax used
in C++ files. Using this ability of the compiler here, we include some files
defining some of the constants that we will use inside the file. -->
<!--This is the file that defines the IDs for all the commands exposed by VisualStudio. -->
<Extern href="stdidcmd.h" />
<!--This header contains the command ids for the menus provided by the shell. -->
<Extern href="vsshlids.h" />
<!--The Commands section is where commands, menus, and menu groups are defined.
This section uses a Guid to identify the package that provides the command defined inside it. -->
<Commands package="guidCRUDSPCommandsPackage">
<!-- Inside this section we have different sub-sections: one for the menus, another
for the menu groups, one for the buttons (the actual commands), one for the combos
and the last one for the bitmaps used. Each element is identified by a command id that
is a unique pair of guid and numeric identifier; the guid part of the identifier is usually
called "command set" and is used to group different command inside a logically related
group; your package should define its own command set in order to avoid collisions
with command ids defined by other packages. -->
<!-- In this section you can define new menu groups. A menu group is a container for
other menus or buttons (commands); from a visual point of view you can see the
group as the part of a menu contained between two lines. The parent of a group
must be a menu. -->
<Groups>
<!-- Table scope -->
<Group guid="guidCRUDSPCommandsPackageCmdSet1" id="TableMenuGroup" priority="0x0600">
<!--<Parent guid="guidSHLMainMenu" id="IDM_VS_MENU_TOOLS" />-->
<Parent guid="guidServerExplorerObjectNode" id="IDMX_DV_OBJECT_NODE" />
</Group>
<!-- Database scope -->
<Group guid="guidCRUDSPCommandsPackageCmdSet1" id="DatabaseMenuGroup" priority="0x0600">
<!--<Parent guid="guidSHLMainMenu" id="IDM_VS_MENU_TOOLS" />-->
<Parent guid="guidServerExplorerObjectNode" id="IDMX_DV_STATIC_NODE" />
</Group>
</Groups>
<!--Buttons section. -->
<!--This section defines the elements the user can interact with, like a menu command or a button
or combo box in a toolbar. -->
<Buttons>
<!--To define a menu group you have to specify its ID, the parent menu and its display priority.
The command is visible and enabled by default. If you need to change the visibility, status, etc, you can use
the CommandFlag node.
You can add more than one CommandFlag node e.g.:
<CommandFlag>DefaultInvisible</CommandFlag>
<CommandFlag>DynamicVisibility</CommandFlag>
If you do not want an image next to your command, remove the Icon node /> -->
<Button guid="guidCRUDSPCommandsPackageCmdSet1" id="cmdidCmdTable" priority="0x0100" type="Button">
<Parent guid="guidCRUDSPCommandsPackageCmdSet1" id="TableMenuGroup" />
<Icon guid="guidImages" id="bmpPic1" />
<Strings>
<ButtonText>Command for Table</ButtonText>
</Strings>
</Button>
<Button guid="guidCRUDSPCommandsPackageCmdSet1" id="cmdidCmdDatabase" priority="0x0100" type="Button">
<Parent guid="guidCRUDSPCommandsPackageCmdSet1" id="DatabaseMenuGroup" />
<Icon guid="guidImages1" id="bmpPic1" />
<Strings>
<ButtonText>Command for Database</ButtonText>
</Strings>
</Button>
</Buttons>
<!--The bitmaps section is used to define the bitmaps that are used for the commands.-->
<Bitmaps>
<!-- The bitmap id is defined in a way that is a little bit different from the others:
the declaration starts with a guid for the bitmap strip, then there is the resource id of the
bitmap strip containing the bitmaps and then there are the numeric ids of the elements used
inside a button definition. An important aspect of this declaration is that the element id
must be the actual index (1-based) of the bitmap inside the bitmap strip. -->
<Bitmap guid="guidImages" href="Resources\CmdTable.png" usedList="bmpPic1, bmpPic2, bmpPicSearch, bmpPicX, bmpPicArrows, bmpPicStrikethrough" />
<Bitmap guid="guidImages1" href="Resources\CmdDatabase.png" usedList="bmpPic1, bmpPic2, bmpPicSearch, bmpPicX, bmpPicArrows, bmpPicStrikethrough" />
</Bitmaps>
</Commands>
<Symbols>
<!-- {d4f02a6a-c5ae-4bf2-938d-f1625bdca0e2} is the object node in the server explorer -->
<GuidSymbol name="guidServerExplorerObjectNode" value="{d4f02a6a-c5ae-4bf2-938d-f1625bdca0e2}">
<!--server explorer - table-->
<IDSymbol name="IDMX_DV_OBJECT_NODE" value="0x8200" />
<IDSymbol name="IDMX_DV_STATIC_NODE" value="0x8100" />
</GuidSymbol>
<!-- {74D21310-2AEE-11D1-8BFB-00A0C90F26F7} is the server explorer -->
<GuidSymbol name="guidServerExplorer" value="{74D21310-2AEE-11D1-8BFB-00A0C90F26F7}">
<!--server explorer - table-->
<IDSymbol name="IDMX_DV_SERVER_NODE" value="0x503" />
</GuidSymbol>
<!-- This is the package guid. -->
<GuidSymbol name="guidCRUDSPCommandsPackage" value="{a71670bc-ef23-40a3-b8a0-ed872b79476c}" />
<!-- Constants-->
<GuidSymbol value="{946311de-35f2-4379-84e2-91867976faf8}" name="guidCRUDSPCommandsPackageCmdSet1">
<IDSymbol value="256" name="cmdidCmdTable" />
<IDSymbol value="257" name="cmdidCmdDatabase" />
<IDSymbol value="258" name="TableMenuGroup" />
<IDSymbol value="259" name="DatabaseMenuGroup" />
</GuidSymbol>
<GuidSymbol value="{679ecb35-41d9-4021-933b-ec6b25afc100}" name="guidImages">
<IDSymbol name="bmpPic1" value="1" />
<IDSymbol name="bmpPic2" value="2" />
<IDSymbol name="bmpPicSearch" value="3" />
<IDSymbol name="bmpPicX" value="4" />
<IDSymbol name="bmpPicArrows" value="5" />
<IDSymbol name="bmpPicStrikethrough" value="6" />
</GuidSymbol>
<GuidSymbol value="{9392ca3d-3400-4b7a-a691-7108032249cd}" name="guidImages1">
<IDSymbol name="bmpPic1" value="1" />
<IDSymbol name="bmpPic2" value="2" />
<IDSymbol name="bmpPicSearch" value="3" />
<IDSymbol name="bmpPicX" value="4" />
<IDSymbol name="bmpPicArrows" value="5" />
<IDSymbol name="bmpPicStrikethrough" value="6" />
</GuidSymbol>
</Symbols>
</CommandTable>

Configuring a filter for Devexpress ASPxGridView

I have a column named Status that display an image corresponding to states. And I have a filter on this column. How can I localize?
<dx:GridViewDataImageColumn Caption="Status" FieldName="Status" Width="100px"
ShowInCustomizationForm="True" VisibleIndex="9">
<Settings AllowSort="True" SortMode="Value" AllowHeaderFilter="True" ShowInFilterControl="True" />
<HeaderStyle HorizontalAlign="Center" />
</dx:GridViewDataImageColumn>
I am not sure that I understand your task correctly. However, it seems that you need to use the gridView's HeaderFilterFillItems event to accomplish your task.

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
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.
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" />

ASP.Net AJAX ValidatorCalloutExtender issue

I am building a User Control (requirement – has to be User Control).
This user control is inside an AJAX Update Panel on the parent page.
The user control has two Infragistics Web Date Chooser controls on it.
Both dates are required.
I have placed asp.net RequiredFieldValicators on both controls.
I have placed ValidatorCalloutExtenders on both.
One control gets validated every time without fail. The other is intermittent. To debug I first removed the ValidatorCalloutExtender from the failing control and sure enough the RequiredFieldValidator fires correctly every time so it appears that the problem is with the ValidatorCalloutExtender. There are not a lot of options for the ValidatorCalloutExtender but I did play with them every way feasible and nothing seems to make any difference. The TargetControlID has to point to the validation control you are extending. Any help appreciated.
Here is the code that works correctly every time:
<igsch:WebDateChooser ID="wdcEndDatePop" runat="server" EnableAppStyling="True"
NullDateLabel="" StyleSetName="eWERKS3" StyleSetPath="~/App_Themes/"
Width="200px" MinDate="2009-01-01" />
<asp:RequiredFieldValidator ID="rfvEndDate" runat="server"
ControlToValidate="wdcEndDatePop" Display="None"
ErrorMessage="End date required." ValidationGroup="endDatePop" />
<cc1:ValidatorCalloutExtender
ID="vceEndDatePop"
runat="server"
CloseImageUrl="~/images/close.gif"
HighlightCssClass="validatorCalloutHighlight"
TargetControlID="rfvEndDate"
WarningIconImageUrl="~/images/back_warning2.gif" />
And here is the code that works intermitemtly:
<igsch:WebDateChooser ID="wdcStartDate" runat="server" EnableAppStyling="True"
NullDateLabel="" StyleSetName="eWERKS3" StyleSetPath="~/App_Themes/"
MinDate="2009-01-01" />
<asp:RequiredFieldValidator ID="rfvStartDate" runat="server"
ControlToValidate="wdcStartDate" Display="None"
ErrorMessage="Start date required." ValidationGroup="access" />
<cc1:ValidatorCalloutExtender
ID="vceStartDate"
runat="server"
CloseImageUrl="~/images/close.gif"
HighlightCssClass="validatorCalloutHighlight"
TargetControlID="rfvStartDate"
WarningIconImageUrl="~/images/back_warning2.gif" />

Resources