How to add custom message with alignment in Welcome message of MSI installer using wix - windows

I used this line in wxl file to add custom message but still not able to align the version number properly
<String Id="WelcomeDlgDescription" Overridable="yes">The Setup Wizard will install [ProductName] on your computer. Click Next to continue or Cancel to exit the Setup Wizard.
{\WixUI_Font_Title}Version - [ProductVersion]</String>
I want the results to be like this
Also, I am not able to change the fonts.
Updated
I am able to achieve this. Version left hanging in the middle and not going at the end,

Limitation: It looks like you can only have one style per string. I am not sure, but it says in the documentation that you have to refer to the style at the beginning of the string:
<TextStyle Id="Test" FaceName="Arial" Blue="255" Size="12" Strike="yes" />
<..>
<String Id="WelcomeDlgDescription">{\Test}Version - [ProductVersion]</String>
Adding Controls and Text
ICE31 - validation suite checking Strings and fields (see Examples)
Customizing WiX Dialogs: You might need to change the whole dialog to add two fields so you can put the version number in its own
text box featuring its own style. Doing so is a little involved, and I have a description of
it here: Customizing WiX Dialogs. Please have a quick read. It also describes how to change font color and style.
Update: Nice little sample for how you can insert a custom dialog: Wix UpgradeVersion.

Related

How to display Bootstrap icons in Xamarin?

I'm new to Xamarin development, but try to be exact.
Using Visual Studio 2022, with Xamarin version 17.0.0.182 (as displayed in VS About).
Found this great article on how to use Bootstrap icons, but it seems to be out of date. When I followed the steps and provided hex codes for the characters, I didn't get the expected glyiphs.
I found that
new Xamarin needs new methods,
new Bootstrap fonts need new ways.
Here they are.
1.) Get the font from the Bootstrap github repo at https://github.com/twbs/icons
Go to releases (https://github.com/twbs/icons/releases), choose latest, scroll down to Assets, download the bootstrap-icons-x.x.x.xip file.
Unzip it, and find fonts/bootstrap-icons.woff.
Not something you can use in Xamarin right away :-(
2.) Convert the woff file to ttf
I googled for a converter and used https://cloudconvert.com/woff-to-ttf
Now you have the ttf you need :-)
3.) Now follow the current Xamarin method of adding a font to your app.
The process is described here: https://devblogs.microsoft.com/xamarin/embedded-fonts-xamarin-forms/
In short:
add the ttf file to the shared Xamarin project, Embedded Resources / Fonts
change file properties / Build Action to "Embedded resource"
register the font by adding a line to the end of Assemblyinfo.cs:
[assembly: ExportFont("bootstrap-icons.ttf", Alias = "Bootstrap")]
4.) Use it in xaml like
<Label FontFamily="Bootstrap" Text=""/>
to display a magnifying glass.
You may also define a Label style, but I'll skip that for now.
4/b.) To use it in xaml via binding
Oh, if things were easy...
When using a binding to display a glyph, there's one more hoop to jump, thanks to these guys for the solution: Using data binding, how do I bind text which contains emojis to a label and have it display correctly?
So, in xaml:
<!-- set BindingContext to MyViewModel -->
<Label FontFamily="Bootstrap" Text="{Binding StateIconName}" />
in your MyViewModel:
public string StateIconName
{
get => WebUtility.HtmlDecode("");
}
5.) To browse available glyphs (icons)
Open the overview page: https://icons.getbootstrap.com/
6.) To find the unicode character code, also referred to as "Unicode HTML Entity"
Check the name of the icon above in step 5.
Open the Bootstrap-icons.css file from Github: https://github.com/twbs/icons/blob/main/font/bootstrap-icons.css
Search for the name of the glyph to find the character code, something like:
.bi-zoom-in::before { content: "\f62c"; }
Use this code in xaml like

Tiny MCE v2.1 code editor

Call me old fashioned, but there is nothing I can do but only to use the old version of Tiny MCE, which is 2.1.
So, what I'm trying to do is to add a "download" attribute to tag, after I open HTML editor I type this attribute, when saving it simply disappears. There is no official documentation to this old version on the official site. The new ones doesn't mention anything about this feature at all. overall editor look. code editor look
Also, I tried to add "download" in the extended valid elements configuration:
extended_valid_elements: "code[class|dir ,however no success as well.
Did anyone by any chance faced the same problem?
Could use a little bit of help.
Well, if anyone ever encounters the same problem, which I highly doubt, you would need to open tiny_mce.js file, and on the line 1928 there will be "A : "id|class|style|title|download" ", this is the place, where I added "download". Afterwards I was able to add this attribute in the HTML code editor.

Is there support for XML code hinting / completion in Sublime Text 2?

I am giving Sublime Text 2 a try and I was editing an XML file - that had a DOCTYPE declaration and a DTD - and there seems to be no way to get code hinting / completion when editing the XML document.
I am sure its something simple I am overlooking. I cannot imagine Sublime does not have this kind of functionality, even if provided via a plugin.
Can someone shed some light on this for me?
Sublime Text is first and foremost a text editor.
But, the reason for it's popularity is in large part due to it's extensibility.
Although you could use Sublime's api to create a specific plug-in to do this, Sublime has a few tools that are already helpful in editing xml files and other markup files on a bare install.
Hinting and completions in particular are very easy to add. It shouldn't take a more than few minutes to create a domain specific sublime-completions file for your particular xml.
You can use alt+shift+w to create an xml element, in addition alt+. will close any un-closed xml element.
You may also want to try the Sublime Tag plug-in available through Package Control
Lastly you could also bring this up in the Sublime forums as a plug-in request. There are a lot of helpful folks in the plug-in community.
You can use the 'tag' plugin from Sublime Package Control. It has auto tag closing, linting and other features. The github page for the project is here: https://github.com/SublimeText/Tag
You can install it using Package Control without leaving your Sublime text editor.

Visual Studio XML summary comment on single line

In Visual Studio, how do I change the default XML summary comment snippet from three lines to one line?
Currently it provides this snippet when I type ///:
/// <summary>
///
/// </summary>
I would like this shorter snippet:
///<summary></summary>
My summaries are often brief and the extra 2 line are unnecessary.
Is there a configuration setting for this or some customizable code/custom addon to fix this.
This is an older question, but I liked Jason Williams's suggestion of creating a snippet for this, so I did. Not very complicated, but copy-and-paste is even easier :)
<?xml version="1.0" encoding="utf-8"?>
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
<CodeSnippet Format="1.0.0">
<Header>
<Title>Single line summary</Title>
<Shortcut>summary</Shortcut>
</Header>
<Snippet>
<Code Language="csharp">
<![CDATA[/// <summary>$end$</summary>]]>
</Code>
</Snippet>
</CodeSnippet>
</CodeSnippets>
You can change the shortcut by (probably obviously) changing the <Shortcut> value.
Paste that into a new file named SingleLineSummary.snippet and save it in the folder %USERPROFILE%\Documents\Visual Studio 2012\Code Snippets\Visual C#\My Code Snippets (modify to fit your version of Windows and Visual Studio).
If you're not familiar with snippets, to use this just put the cursor above a method/property/etc, start typing summary, and then hit TAB a couple of times.
Personally, I think this should be part of the VS editor itself. I know it's been requested in the past. In the meantime, the snippet idea is a good one, but the behavior is slightly different. If you want to keep the same behavior and if you are willing to purchase a 3rd party add-on, then SubMain has a product called "GhostDoc Pro" that, with a little bit of effort, will do this for you. (Note that they have a free, non-"pro" version, "GhostDoc", but I don't think it will work.)
If you want to go this route, here's how it works.
After installing GhostDoc Pro, go to your Tools menu. At the top will be a new fly-out submenu, "GhostDoc Pro".
Go to Tools -> GhostDoc Pro -> Options -> Rules
You will need to edit the T4 template for EACH type that you want this to take effect on.
Click on the rule and then hit "Edit"
At the top, modify
/// <summary>
///<# GenerateSummaryText(); #>
/// </summary>
to be just
/// <summary><# GenerateSummaryText(); #></summary>
In the method GenerateSummaryText, modify each this.WriteLine to be just this.Write
Hit OK to save, move on to the next template.
Before closing the options page, head up to "General" (from "Rules") and check the "Highlight auto-generated summary when Document This". This will cause the newly inserted auto-text to be selected off the bat so if you don't like it, you can just start typing. Of course, if you prefer to have the text just not generated at all, then you can do that, too, but you will have to modify the T4 templates a bit more. Specifically, you'll need to have GenerateSummaryText just use a single line,
this.Write(Context.ExecMacro("$(End)"));
This will have it not generate any text, but will put the cursor between the 2 <summary> tags.
Side Note:
If anyone knows of a way to get ReSharper or other add-on tools to do this, I'd be interested in seeing that solution as well--if for no other reason than just curiosity.
You can manually format the comment however you like it, as long as it remains valid xml.
The cheapest approach might be to disable the automatic comment-building action in Visual Studio (Tools > Options > Text Editor > C# > Generate XML Documentation comments for ///) and use a code snippet to insert /// <summary></summary>.
If you want the default format to be a single line, and/or help to keep the format tidy and readable, my addin Atomineer Pro Documentation may also be of interest. Among the many options is one to use a compact 1-line format for any comment that is short enough to fit on a single line. It is specifically designed to do this, so it may work better for your needs.
A final suggestion is that there are several other add-ins (Resharper, etc) that can generate simple boilerplate xml doc-comments - I believe some of these addins can be configured to use a particular text snippet. If you already have such an addin, it may be that yours can be adjusted to provide the one-line format you require, in a slightly more advanced manner than is possible with the basic Visual Studio tweak suggested above.
I was trying to do this today. I couldn't find a way to change it to happen automatically, so I figured I could do it afterward with find and replace and regex. It isn't a good answer to this question, but it doesn't appear there is a good answer and all the answers are workarounds. This is a good work around.
VS with Regex
Find: (/// <summary>)\r\n\s*///\s*(.*)\r\n\s*///\s*(</summary>)
Replace: $1$2$3
Notepad++ with regex
Find: (/// <summary>)\r\n\s*///\s*(.*)\r\n\s*///\s*(</summary>)
Replace: \1\2\3

Why can't I add a XML datasource in Expression Blend 3?

I'm using Expression Blend 3
I click on "add live datasource", "add new xml datasource"
copy in a URL
but the OK button remains blank
adding a local XML datasource file works fine
How can I add a URL datasource in expression blend 3?
does this work for anyone else?
The problem is on every Expression Blend 3 I install on any computer, seems to simple be turned off in the beta.
alt text http://tanguay.info/web/external/blenddataokbutton.png
I just tried using blend 1.0. This version also had other options, such as 'infer xml schema'.
My guess is that there was some check added in later version to ensure that the file pointed to has an extension.
My suggestion is to edit the xaml directly. Note, this is old XAML from blend 1.0:
<Window.Resources>
<XmlDataProvider x:Key="rssDS" d:IsDataSource="True" Source="http://www.tanguay.info/web/rss/"/>
</Window.Resources>
Hope that helps, let me know.
I ran into the same problem when I tried to reimport a sample data from an XML file. The data source already exists or at least Blend thinks it still exists. You should see a warning if you mouse-over the Data Source Name textbox.
Delete the data source from the Data tab.
Delete the folder in the project view.
Rebuild the project.
If that doesn't clear it out, restart Blend.
That's what I had to do. I have Expression 4.0 Ultimate.

Resources