adding new line in the description of the dialog in wix localization string element - wix

I'm new to WiX, and using WiX v3.0.
I'm using the WixUI_Advanced dialogs. I customized InstallDirDlg description by adding a .wxl (WiX localization) file.
However, I cannot add a newline in the description.
I tried following to get a new line,
1. <String Id="InstallDirDlgDescription">Hello\nHai</String>
2. <String Id="InstallDirDlgDescription">Hello
Hai</String>
3. <String Id="InstallDirDlgDescription">Hello</String>
<String Id="InstallDirDlgDescription" Overridable="yes">Hai</String>
4. <String Id="InstallDirDlgDescription">Hello
Hai</String>
But, none of those options work. Any suggestions.

It appears you've found a bug in the .wxl handling in the WiX toolset. I would expect option number 4 or the following to work:
<String Id="InstallDirDlgDescription"><![CDATA[Hello
Hai]]></String>
At this point, you'll probably be best served opening a WiX toolset bug. You might even consider enlisting in the code and trying to root cause the issue to help get the bug fixed. Seems like it should work.

Related

How to create a DNN widget?

If I understood correctly, DNN widget is a way to add a js to every page on the website using module or theme. Right?
My goal evantually is to add a js to every page on a portal and preferably to do that via module that has no need to be added to every page manually.
My plan B is adding module and using setting "Display Module on All Pages", but widget seems to be a better way to do that.
At first I've tried to use this instruction. I've added the YourCompany.Widgets.SampleWidget.js file to root of existing DNN module. Also in the .dnn manifest file inside components tag I've added another component like this:
<component type="Widget">
<widgetFiles>
<basePath>YourCompany</basePath>
<widgetFile>
<name>YourCompany.Widgets.SampleWidget.js</name>
</widgetFile>
<widgetFile>
<name>license.txt</name>
</widgetFile>
<widgetFile>
<name>releasenotes.txt</name>
</widgetFile>
</widgetFiles>
</component>
I've got this error on module installation:
Failure File specified in the dnn could not be found in the zip file: - D:\Projects\website.com.ua\Host\Install\Temp\vp1vioj1\YourCompany.Widgets.SampleWidget.js
vp1vioj1 part is changing every time (seems like it's some unique id that is generating on module install).
Then I tried to place this widget component inside another package tag after checking this article. Like this:
<dotnetnuke type="Package" version="5.0">
<packages>
<package name="ModuleName" type="Module" version="00.00.01">
<!-- some module content here -->
</package>
<package name="YourCompany.SampleWidget" type="Widget" version="00.00.01">
<components>
<component type="Widget">
<widgetFiles>
<basePath>YourCompany</basePath>
<widgetFile>
<name>YourCompany.Widgets.SampleWidget.js</name>
</widgetFile>
</widgetFiles>
</component>
</components>
</package>
</packages>
</dotnetnuke>
But I still got the same error on install. I didn't find any other instructions or documentations regarding widgets. When I tried to check the DNN source code - it seems to be also very time consuming and hard way.
So could you please help me to clarify this?
Support for Widgets in DNN Platformnwas dropped a number of years ago.
Your best option if you want something ok all pages would either be to look at a SkinObject, like the breadcrumb or Login for example. Or a traditional module but marking it “display on all pages”
First, you might want to take a look at the concept of DNN Extensions and how they are built and packaged.
If examples of versions DNN extensions, https://github.com/WillStrohl/dnnextensions. The examples include a widget. So check it out.
Now, what you posted looks like a .dnn file, which the the manifest file that is intended to be a part of a packaged DNN extension. Code and other bits and pieces go into the packaged extension (really a specially named zip file). The packaged extension is installed into your DNN installation via the Extensions Persona Bar page (click the Install Extension there).
From my experience with DNN (2006 to now), I believe that I can say that a DNN Widget is something that I've never had anything to do with. So, you may be barking up an old any dying tree in the project.
If you want something included on every page, it makes more sense to include it in the theme (skin). If you want a javascript file, add that to your theme project and have the .ascx files include it, probably using https://docs.dnncommunity.org/api/DotNetNuke.Web.Client.ClientResourceManagement.html (see https://docs.dnncommunity.org/api/DotNetNuke.Web.Client.ClientResourceManagement.html)
But, if you are determined to use a widget, start with https://www.kalyani.com/blog/2009/12/25/dotnetnuke-widgets-guide-part-1-of-4/

Displaying MSI version parts at the Wix Burn Bundle level (to display in title / caption)

I've discovered how to access the parts within the MSI/Product tag. But my goal was to set the caption of the burn installer based on the Major/Minor version number.
This code below is the summary of what I tried to do, but this doesn't work (I think because I'm not within the Product tag).
Burn wxs:
<Wix>
<Bundle Version="!(bind.packageVersion.<packageName>)" >
<Variable Name="ProductVersionMajor" Value="!(bind.property.ProductVersion.Major)"/>
<Variable Name="ProductVersionMinor" Value="!(bind.property.ProductVersion.Minor)"/>
....
Theme.wxl:
<WixLocalization ...>
<String Id="Caption">[WixBundleName] [ProductVersionMajor].[ProductVersionMinor] Setup</String>
....
Is there some kind of work around where I can get this information at the bundle level without writing custom code?
This answer here was useful, but not quite what it appears I need; since I'm not within the WIX product tag for the inner MSI.
!(bind.property.ProductVersion.Major) is a bind variable when building an MSI, not a bundle. The available bind variables are documented at https://wixtoolset.org/documentation/manual/v3/overview/light.html. There is an open feature request for MsiPackage property bind variables at https://github.com/wixtoolset/issues/issues/4298. It would likely be additional work to get the ProductVersion.Whatever part working, so if you want that then you should add a comment to that issue.
In addition to #Sean's answer, if you are only interested in the full version and not in any breakdown of major/minor/build then the below example I have the caption in the localization WXL file can be defined as simple as:
<WixLocalization Culture="en-us" Language="1033" xmlns="http://schemas.microsoft.com/wix/2006/localization">
<String Id="Caption">[WixBundleName] Setup (v. [WixBundleVersion])</String>
...
and in my bundle.wxs file I have the following definition:
<Bundle Name="$(var.MyProductFullName)"
Version="!(bind.packageVersion.MyPackageId)"
Manufacturer="!(bind.packageManufacturer.MyPackageId)">
...
where the variable MyProductFullName is defined in my variables file under my package's installer project. So basically the [WixBundleName]
and [WixBundleVersion] are bound to the Bundle element's Name and Version attribute values, respectively.

Creating Element as first item within another element using Wxs (Windows Installer)

I am using Wix installer for an application and one of the scenarios I am trying to handle is changes to a .config file when the application is upgraded.
Essentially, I would want to add an Xml Element within another Xml Element.
For instance, the original .config file that was shipped with application looked like this
<root-element>
<sub-element-1/>
<sub-element-2/>
</root-element>
During app lifetime, it was updated to as below at some point.
<root-element>
<sub-element-0/>
<sub-element-1/>
<sub-element-2/>
</root-element>
For handling this case , where I need to add <sub-element-0/> under <root-element>, I tried this Wxs code.
<util:XmlFile Id="MyConfig"
File="[fileidOfMyConfigFile]"
Action="createElement"
Name="sub-element-0"
ElementPath="root-element"
Sequence="1"/>
The above formulation does add the sub-element-0 under root-element , however as the last item under the root-element.
like so
<root-element>
<sub-element-1/>
<sub-element-2/>
<sub-element-0/>
</root-element>
I couldn't find any resources on adding it as first element as I want it to be.
Any suggestions on how it could be accomplished?
Note: The above is a simplified version of my use case. The reason order is important in my case is due to a limitation on the framework that some elements need to occur before other elements in the .config

Wix CloseApplication Element Not Working with Bundle.wxs

The short question is: How to use util:CloseApplication element in a Bundle.wxs file?
Details:
I made it work as desired in Product.wxs file with following syntax but it's not working/executing when used in Bundle file
<util:CloseApplication Id="closePowerPoint"
Target="POWERPNT.EXE"
Description="Please close PowerPoint application to proceed."
PromptToContinue="yes"
></util:CloseApplication>
Am I missing something in bundle file to make it work, or it's not possible/recommended to use it that way?
Any idea or solution would be highly appreciated.
CloseApplication represents a custom action so can therefore be used only in an MSI package.

Wix Error ICE17: Bitmap: ' is launching

I'm trying to develop a Wix project. I'm using Wix 3.6, and everything goes perfect, except when I try to change the default interface of Wix to the WiUI_Mondo one.
I do the following to change the interface:
Add reference to WixUIExtension.dll
Add <UIRef Id="WixUI_Mondo" />
With these simple steps, I should be able to change the interface of my Wix installer. Instead, it is launching an error like this:
Error: ICE17: Bitmap: '
And no more text after the simple comma.
Any idea on why is this happening??
EDIT: This mistake comes from several .wxs files, such as PrepareDlg.wxs, FilesInUse.wxs...
I don't know the exact reason, but you can see in msdn what ice17 is testing:
ice 17 documentation