Wix does not set property value based on checkbox on unistall - checkbox

I have inside my MyVerifyReadyDlg.wxs checkbox control defined as following:
<Control Id="REMOVELOGSFILESCHECKBOX" Type="CheckBox" X="170" Y="170" Width="80" Height="17"
Property="REMOVINGLOGSPROPERTY" CheckBoxValue="0" Text="Remove logs files">
<Condition Action="show">Installed</Condition>
<Condition Action="hide">NOT Installed</Condition>
</Control>
and inside Product.wxs I have defined the property as:
<Property Id="REMOVINGLOGSPROPERTY" Secure="yes"/>
and also inside Product.wxs I have this component to remove a log files on uninstall:
<Component Id="logsFolderComponent" Guid="*" Directory="logsFolder">
<Condition>REMOVINGLOGSPROPERTY</Condition>
<RemoveFile Id="allLogsFiles" Name="*.log" On="uninstall"></RemoveFile>
</Component>
The problem is: it does not set the property(stays null) when I check the checkbox during an uninstallation, but if I use the checkbox on installation it removes the log files.
How I can set the property on uninstall?

Properties aren't automatically preserved anywhere between install and later operations. WiX provides the "remember property" pattern for this.
http://robmensching.com/blog/posts/2010/5/2/the-wix-toolsets-remember-property-pattern/

Related

Showing WixUI_dialog conditionally

Currently struggling with an installer that should have different behaviour depending on a registry value.
If the registry value is not set then the installer should show the classic dialog to select the installation path and then store that path in the registry so that next time the .msi file, or an updated version thereof, is processed, it "knows" exactly where the repair should be made or the update deployed.
I have these snippets in my product.wxs:
<!-- Registry key location -->
<Property Id="MBREGISTRYKEY" Value="SOFTWARE\MyCompany\MyApp" Secure="yes"/>
<Property Id="PREVIOUS_PATH" Secure="yes">
<RegistrySearch Root="HKLM" Key="[MBREGISTRYKEY]" Name="Path" Type="directory" Id="PreviousPath"/>
</Property>
and
<Fragment>
<WixVariable Id="WixUIBannerBmp" Value="$(var.SolutionDir)Assets\Visuals\wix-banner.bmp"/>
<WixVariable Id="WixUIDialogBmp" Value="$(var.SolutionDir)Assets\Visuals\wix-background.bmp"/>
<UI>
<UIRef Id="WixUI_InstallDir"/>
<Publish Dialog="WelcomeDlg" Control="Next" Event="NewDialog" Value="InstallDirDlg" Order="2">1</Publish>
<Publish Dialog="InstallDirDlg" Control="Back" Event="NewDialog" Value="WelcomeDlg" Order="2">1</Publish>
</UI>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="INSTALLATIONDIR">
<Directory Id="CONFIGINSTALLATIONDIR" Name="config" />
</Directory>
</Directory>
<SetDirectory Id="INSTALLATIONDIR" Value="[WindowsVolume]MyApp" />
<Property Id="WIXUI_INSTALLDIR" Value="INSTALLATIONDIR" />
</Fragment>
I have found plenty of examples here on SO and elsewhere that allow the installer to display different dialogs depending on conditions such as a registry value or an environment variable. What I have found nowhere is an example of what I'm trying to achieve, which is skipping the UI altogether, not just one or two of the dialogs in the UI, if my registry value is set. This is a requirement because deployment of updates must be unattended.

How to add control to the module

I've seen a few examples but they are outdated.
I'm using standard template for module creation with View, Edit, Setting.
I'm adding a new control TestPage : MyModuleBase
in mymodule.dnn
<moduleControl>
<controlKey>TestPage</controlKey>
<controlSrc>DesktopModules/mymodule/TestPage.ascx</controlSrc>
<supportsPartialRendering>False</supportsPartialRendering>
<controlTitle>TestPage.ascx</controlTitle>
<controlType>Edit</controlType>
<iconFile />
<helpUrl />
<viewOrder>0</viewOrder>
</moduleControl>
then on View on button click:
this.Response.Redirect(DotNetNuke.Common.Globals.NavigateURL(this.TabId, "TestPage"));
and it redirects to /mymodule/ctl/TestPage/portalid/0 and it is empty.
What is wrong in my settings?
You have to use EditURL instead of NavigateURL in order to specify you want to load a specific control for the module that the moduleID is specified in the URL.

Obout Suite Superform DateField issue

I am using the Obout Suite in a website.
I have a SuperForm control in which I have inserted some controls like BoundFields or DateFields.
The problem is that when I select a date at the DateField Calendar, the textbox associated doesn't refresh the value of the date.
I have something like:
<obout:SuperForm ID="SuperForm2" runat="server" AutoGenerateInsertButton ="true" AutoGenerateEditButton="false" AutoGenerateDeleteButton="false" AutoGenerateRows="false" DataKeyNames="IdDocumento" DefaultMode="Insert" Width="525" DataSourceID="SqlDataSource2">
<Fields>
<obout:BoundField DataField="DocumentType" HeaderText="Name" FieldSetID="FieldSet1" />
<obout:DateField DataField="OrderDate" HeaderText="Order Date" FieldSetID="FieldSet2" DataFormatString="{0:MM/dd/yyyy}" ApplyFormatInEditMode="true" />
<obout:DateField DataField="RequiredDate" HeaderText="Required Date" FieldSetID="FieldSet2" DataFormatString="{0:MM/dd/yyyy}" ApplyFormatInEditMode="true" />
</Fields>
<FieldSets>
<obout:FieldSetRow>
<obout:FieldSet ID="FieldSet1" />
</obout:FieldSetRow>
<obout:FieldSetRow>
<obout:FieldSet ID="FieldSet2" />
</obout:FieldSetRow>
</FieldSets>
</obout:SuperForm>
The tag prefix is:
<%# Register TagPrefix="obout" Namespace="Obout.SuperForm" Assembly="obout_SuperForm" %>
The "obout_Calendar2_Net.dll" is referenced by the solution.
Am I forgotting something?
Thanks in advance.
Cartojal
Well, finally I found the solution. If you are using .net 4.0, like me.... you must to add the attribute clientIDMode="AutoID" to the section "pages" at the web.config file:
<pages clientIDMode="AutoID">
....
</pages>
This generate the asp.net controls ids like past versions of .net

WiX. Run a custom action when a checkbox is checked

I have two files Product.wxc there i wrote
<Property Id="CheckBoxProp">
and Custom Action
<InstallExecuteSequence>
<Custom Action="MyCustomAction" After="InstallInitialize">
CheckBoxProp=1
</Custom>
</InstallExecuteSequence>
In another file MyCheckBoxDlg.wxc I wrote UI dialog there I described checkbox
<Control Type="CheckBox" Id="MyCheckBoxID" Width="125" Height="26" X="26" Y="124" Text="My text" Property="CheckBoxProp" CheckBoxValue="1" />
All publishs I wrote in another file where I have a DialogRef to MyCheckBoxDlg
When I start my installation customaction doesn't see change of value CheckBoxProp.
Help plz! I wait for your help.
CheckBoxProp is a private not a secure (public) property. Change it to CHECKBOXPROP and use the Secure attribute to get it listed in the SecureCustomProperties property.

iBatis - Why is sqlMapConfig.xml unable to find the sql maps defined in it?

I have a sqlMapConfig.xml that has three SQLMaps defined in it.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sqlMapConfig
PUBLIC "-//ibatis.apache.org//DTD SQL Map Config 2.0//EN"
"http://ibatis.apache.org/dtd/sql-map-config-2.dtd">
<sqlMapConfig>
<!-- Statement namespaces are required for Ibator -->
<settings enhancementEnabled="true" useStatementNamespaces="true"/>
<!-- Setup the transaction manager and data source that are
appropriate for your environment
-->
<transactionManager type="JDBC">
<dataSource type="SIMPLE" >
<property name="JDBC.Driver"
value="com.mysql.jdbc.Driver"/>
<property name="JDBC.ConnectionURL"
value="jdbc:mysql://localhost:3306/sug"/>
<property name="JDBC.Username"
value="root"/>
<property name="JDBC.Password"
value="admin"/>
</dataSource>
</transactionManager>
<!-- SQL Map XML files should be listed here -->
<sqlMap resource="com/tatakelabs/dbmaps/categories_SqlMap.xml" />
<sqlMap resource="com/tatakelabs/dbmaps/pro_SqlMap.xml" />
<sqlMap resource="com/tatakelabs/dbmaps/pro_category_SqlMap.xml" />
</sqlMapConfig>
I get a runtime error - Cause: java.io.IOException: Could not find resource com/tatakelabs/dbmaps/categories_SqlMap.xml
categories_SqlMap.xml is present in that location. I tried changing the location of the map xml, but that did not help. sqlMapConfig.xml validates against the DTD. categories_SqlMap.xml also validates against the right DTD. I am at my wits end trying to figure out why it can't find the resource. The sqlMap files are generated by iBator.
This was happening because the sqlmap file location was not getting copied to target. Added a copy goal and that fixed it.
I had the same problem. It appears the problem lies with the location of the config file. Thus, its in relation of the project resource structure.
I moved the config file in the same package as the mapper classes and it worked. In this case try moving all the resources to this package and update the resource attributes to:
<sqlMap resource="categories_SqlMap.xml" />
<sqlMap resource="pro_SqlMap.xml" />
<sqlMap resource="pro_category_SqlMap.xml" />
Solved it.
I moved the xml file to where the Pojo was located and provided the path as follows:
<sqlMap resource="com/heena/ibatis/model/jsr/jsr.xml" />
And it worked.
place it ...src\java\abc.xml under the Source Packages directory.
If you are using Spring, you can use a SqlMapClientFactoryBean specifying property "mappingLocations". In this property you can specify a generic path, such as "com/tatakelabs/dbmaps/*_SqlMap.xml" or with a variable such as ${mapfiles}, that will be resolved by Spring as an array of file names. This lets you omit sqlMap element in sqlMapConfig. This technique will run with iBatis 2.3.4 on. However sql-map-config-2.dtd is also contained inside iBatis.jar, so you can experience some parsing errors, as /com/ibatis/sqlmap/engine/builder/xml/sql-map-config-2.dtd may have a bug. In this case you may want to replace it inside the jar with the one from the URL:
http://ibatis.apache.org/dtd/sql-map-config-2.dtd.

Resources