Monday, July 11, 2011

WPF: XP style for Ribbon application without title bar

Those who decided to use MS WPF Ribbon probably knows that it has an ugly W98 style on Windows XP.

I have found a solution that works for me.
I decided to use Window instead of RibbonWindow for the application, but in this case it has a title bar:


Finally I've found the following post with example how to hide the bar:
http://blogs.msdn.com/b/wpf/archive/2010/08/20/ribbon-browser-application-without-the-title-row.aspx
It's written for the ribbon browser application but it also works for window application.

In comment to the post I've found the easiest way to hide the bar by changing only .xaml file without modifying .cs.
Just add negative margin to the Ribbon control:
Margin = 0,-26,0,0
It will result the following:

Wednesday, July 6, 2011

WIX: Sleep between Custom Actions during installation

If you require to pause your installation between some custom actions, you can use the following:
<Property Id="QtExecDeferred" Value='"ping" -n 15 127.0.0.1'/><CustomAction Id="QtExecDeferred" BinaryKey="WixCA" DllEntry="CAQuietExec" Execute="deferred" Return="check" Impersonate="no"/>
The QtExec allows to run command line silently.

WIX: How to run Command Line silently

WIX provides a Custom Action that allows to run Command line silently - Quiet Execution Custom Action

You should use it exactly the same way as listed in the WIX example. Just put your command in the Properties value.

<Property Id="QtExecCmdLine" Value='"command" parameters'/><CustomAction Id="QtExecExample" BinaryKey="WixCA" DllEntry="CAQuietExec" Execute="immediate" Return="check"/>

Make sure the command has double quotes. For example: '"ping" -n 15 127.0.0.1'

Don't forget to add the WixUtilExtension extension during building the msi package.