I want to have modified Customize dialog, so I created one. But I want to show this custom dialog after Welcome dialog in mondo UI.
If I do that:
<Publish Dialog="WelcomeDlg" Control="Next" Event="NewDialog" Value="CustomizeDlg">1</Publish>
<Publish Dialog="CustomizeDlg" Control="Back" Event="NewDialog" Value="WelcomeDlg" Order="3">1</Publish>
<Publish Dialog="CustomizeDlg" Control="Next" Event="NewDialog" Value="CustomCustomizeDlg" Order="4">1</Publish>
<Publish Dialog="CustomCustomizeDlg" Control="Next" Event="NewDialog" Value="VerifyReadyDlg" Order="4">1</Publish>
<Publish Dialog="CustomCustomizeDlg" Control="Back" Event="NewDialog" Value="CustomizeDlg" Order="4">1</Publish>
<Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="CustomCustomizeDlg" Order="4">1</Publish>
then everything works fine... but if I make something like this:
<Publish Dialog="WelcomeDlg" Control="Next" Event="NewDialog" Value="CustomCustomizeDlg">1</Publish>
<Publish Dialog="CustomCustomizeDlg" Control="Back" Event="NewDialog" Value="WelcomeDlg" Order="3">1</Publish>
<Publish Dialog="CustomCustomizeDlg" Control="Next" Event="NewDialog" Value="VerifyReadyDlg" Order="4">1</Publish>
<Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="CustomCustomizeDlg" Order="4">1</Publish>
Then none of Customize dialog is shown, instead of that, license dialog is shown after welcome...
I did not get it at all... this behavior is strange for me... Any ideas?
EDIT:
I just discover that in msi DB is registered control event on WelcomeDlg next for CustomCustomizeDlg but also for LicenseDialog and both with order 1... if I delete row for licenseDialog it is working ok, so now my question is how to delete that row without using orca...
You don't need to delete it, just add your control event with a greater order than 1 (try 10 or so to be sure) and it will take precedence.
When more than one NewDialog is a candidate to be opened, only the one with the greatest order number will be selected. You can find a similar question answered here or here.
Additionally you can read about the events ordering in the MSDN ControlEvent table documentation:
The exception to note is that each control can publish a most one NewDialog or one SpawnDialog event. If you need to author multiple NewDialog and SpawnDialog control events in this table, also include conditional statements in the Condition fields that ensure at most one event is published. If multiple NewDialog and SpawnDialog control events are selected for the same control, only the event with the largest value in the Ordering column gets published when the control is activated.
Related
I have a WIX Project consisting of some wxs files.In my one wxs file namely "DBFile" I want to hide one label say "lbl" at runtime depending upon the Properties.
i.e. If my property say "IsDbExists" is true then i want to show label "lbl" otherwise it should be hidden.
How can i achieve this?
Like this:
<Control Id="LoginTextBox" Type="Edit" ...>
<Condition Action="hide" >IsDbExists<>1</Condition>
<Condition Action="show" >IsDbExists=1</Condition>
</Control>
I`m having trouble finding out how to change the value of a checkbox (=property) on deselect.
What I`ve got this far:
<Property Id="INSTALLEXCEL2007" />
<Control Type="CheckBox" Id="Excel2007_Checkbox" Width="88" Height="17" X="22" Y="120" Text="Excel 2007" Property="INSTALLEXCEL2007" CheckBoxValue="1" />
The code says that the property INSTALLEXCEL2007 will get the value 1, if the user checks it.
Now, if it is unchecked, the value still remains 1. Meaning, each click on the checkbox assigns the value 1 to this property.
Is there any way to have a "unchecked value"?
I have already tried this, but it didn`t work in my case.
If user unselects the Checkbox the property will be deleted or it value goes to null. You can use the uncheck condition like below.
INSTALLEXCEL2007 <> 1
If you test the Checkbox property value(check and uncheck) in dialog using text control, it won’t get updated. You need to publish the property or if you click next or back button, it will be updated.
After hours of trying to get it done with checkboxes, I`ve switched to combo boxes.
It has been really easy to use them, though its not as a pretty as it would have been with checkboxes.
Here`s an example of one of my combo boxes (maybe someone might find it useful):
<Control Type="ComboBox" Id="Excel2007_Combobox" Width="75" Height="14" X="165" Y="114" ComboList="yes" Property="INSTALLEXCEL2007">
<ComboBox Property="INSTALLEXCEL2007">
<ListItem Text="No" Value="0" />
<ListItem Text="Yes" Value="1" />
</ComboBox>
</Control>
After selecting a value, it`s easy to use the value of the property "INSTALLEXCEL2007" as a condition:
<Publish Dialog="ExcelChooserDlg" Control="ExcelChooser_Accept" Event="SpawnDialog" Value="WarningDlg_NoOfficeVersion" Order="1"><![CDATA[INSTALLEXCEL2007<>"1"]]></Publish>
How can I set up that the code is reformatted automatically on saving?
So I don't always have to press Ctrl + Alt +
L.
Actually it is possible.
The idea is to record a very simple macro that selects all the lines (Ctrl+A), formats (Ctrl+Alt+L), deselect all (Up and Down arrow) and saves a file (Ctrl+S), and bind this macro to Ctrl+S.
Free Ctrl+S changing keyboard shortcut for "Save all"
open File > Settings;
search for "keymap" and open it;
search "Save All" and double click the action "Save all";
select "Remove Ctrl+S";
double click "Save All" again and select "Add Keyboard Shortcut";
select "Ctrl+Alt+Shift+S" as first stroke.
Confirm and exit from Settings.
Record the macro
Edit > Macros > Start Macro recording
Press Ctrl+A, then Ctrl+Alt+L, then Up arrow, then Down arrow, and finally then Ctrl+Alt+Shift+S
Stop recording the macro clicking on the Stop button on the bottom right of the page.
Give this macro a name like "Format and Save"
Assign Ctrl+S to "Format and Save"
open File > Settings;
search for "keymap" and open it;
search "Format and Save" and double click the action "Format and Save";
select "Add Keyboard Shortcut";
select "Ctrl+S" as first stroke.
Confirm and exit from Settings.
Finally, enjoy PhpStorm!
I use Save Actions Plugin https://plugins.jetbrains.com/plugin/7642-save-actions for PhpSorm
Settings -> Tools -> Action on Save -> Reformat code
Another thing that I found very helpful in combination with this macro is the
Show Reformat File Dialog.
In case you want to only reformat the code you just changed, you can set the option:
Only VCS changed text
The dialog can be opened through the following shortcut:
CTRL+ALT+SHIFT+L
Checked on PHPStorm 2020 & greater versions and found a plugin named Save Action. But make sure you configure for new and exisiting projects.
You can also export your PHPStorm settings and then unzip & replace/create the following :-
Macro File under Settings/Option/macro.xml
<application>
<component name="ActionMacroManager">
<macro name="Format & Save">
<action id="ReformatCode"/>
<action id="SaveAll"/>
</macro>
</component>
</application>
Settings/Keymaps/Default Copy.xml
<keymap version="1" name="Default copy" parent="Default for XWin">
<action id="DBNavigator.Actions.SourceEditor.Save"/>
<action id="Macro.Format & Save">
<keyboard-shortcut first-keystroke="ctrl s"/>
</action>
<action id="SaveAll">
<keyboard-shortcut first-keystroke="shift ctrl alt s"/>
</action>
</keymap>
Now Zip it back & import it & whenever you press ctrl+s - Auto Code Format will be done.
From v2017.2.4 CTRL + ALT + L doesn't work. Use alt + F8 instead.
Solution:
Use: ALT + F8 to format the code.
When creating a macro as described by Luca Mastrostefano, use:
alt + F8 to format and then ctrl + alt + s to save.
I have a Wix Control PushButton which has several Publish events
here is the xml
<Control Id="Next" Type="PushButton" X="0" Y="0" Width="50" Height="20" Default="yes" Text="!(loc.WixUINext)">
<Publish Event="SpawnDialog" Value="ErrorDialog">
<![CDATA[PROPERTY1 = "1" AND PROPERTY2 = "1"]]>
</Publish>
</Control>
But the dialog is not appearing even though both properties are equal to 1
I Found the problem pretty much straight after i posted. So am putting it here incase anyone else makes the same mistake i did.
Straight after my publish event i had another event which was getting fired to move onto the next dialog screen
<Publish Event="NewDialog" Value="CustomizeDlg">1</publish>
so even though my error dialog should show, this next event sort of overwrites it and you dont get to see it. to stop this happening i had to write in logic to prevent it from moving on.
<Publish Event="NewDialog" Value="CustomizeDlg">
<![CDATA[PROPERTY1 = "1" AND PROPERTY2 = "0"]]></Publish>
so now if both properties have been set it will show the error dialog, but if only the first one has been set i will move straight onto the CustomizeDlg. As long as the conditions are different and one will fail and the other pass this works a charm.
I am using Wix::Extensions::CommonUi from AppSecInc.
I need to deploy two databases in my MSI and need to collect the db connection information from the user for both databases.
I would like to utilize DbCreateCredDlg dialog.
<UI>
....
<DialogRef Id="DbCreateCredDlg" />
<!- use DbCreateCredDlg for database 1 ->
<!- use DbCreateCredDlg for database 2 ->
...
</UI>
Is there any way I can use the this dialog more than once in the same MSI?
I suppose you should pull the sources of that dialog to include in your sources and modify it accordingly. For instance, add a condition when the Next button of this dialog returns it to self for database 2 data. You'll need to preserve the data in the properties tied to dialog controls before prompting the user to enter the data for database 2.
So, the Next button will do the following (just behavior algorithm):
if DB=1, preserve entered data for database1
set DB=2
show this dialog again
if DB=2, preserve entered data for database2
show next dialog in sequence
The similar thing should be done for Back button of that dialog.
Hope you get the idea.