Adding wix support for VS.NET

 the .xsd files in the wix\doc directory to C:\Program Files\Microsoft Visual Studio 8\Xml\Schemas directory.<div style="clear: both; padding-bottom: 0.25em;"></div>

Validate if checkbox is checked using really easy validation

/ Needs Really easy validation.js script & prototype.js /

function validateIfChecked(v, e) {
var cbId = e.getAttribute(‘usecheckbox’);
if (cbId != ‘undefined’) {
if ($(cbId).checked) {
var validationType = getValidationType(e);
return !Validation.get(‘IsEmpty’).test(v) && Validation.get(validationType).test(v)
}
else {
$(e).value = ‘’;
return true;
}
}
return true;
}

function getValidationType(e) {
var classes = e.className.split(‘ ’);
for (i = 0; i < classes.length; i++) {
if (classes[i].indexOf(‘validate-checkbox-’ >= 0))
return classes[i].replace(‘validate-checkbox-’, ‘’);
}
return ‘validate-number’; // default;
}

Validation.add(‘validate-checkbox-required’, ‘Please provide a valid value when checked’, validateIfChecked);
Validation.add(‘validate-checkbox-validate-number’, ‘Please provide a valid value when checked’, validateIfChecked);
Validation.add(‘validate-checkbox-validate-digits’, ‘Please provide a valid value when checked’, validateIfChecked);
Validation.add(‘validate-checkbox-validate-alpha’, ‘Please provide a valid value when checked’, validateIfChecked);
Validation.add(‘validate-checkbox-validate-alphanum’, ‘Please provide a valid value when checked’, validateIfChecked);
Validation.add(‘validate-checkbox-validate-date’, ‘Please provide a valid value when checked’, validateIfChecked);
Validation.add(‘validate-checkbox-validate-email’, ‘Please provide a valid value when checked’, validateIfChecked);
Validation.add(‘validate-checkbox-validate-url’, ‘Please provide a valid value when checked’, validateIfChecked);
Validation.add(‘validate-checkbox-validate-currency-dollar’, ‘Please provide a valid value when checked’, validateIfChecked);

Realy Easy Validation


Ajax javascript issues.

Javascript functions injected into the DOM using innerHTML will not work. So using something like:
<br />mydiv.innerHTML = [html result from ajax method call];<br />&hellip;<br /><div id=&ldquo;mydiv&rdquo;><br /></div><br />
make sure the [html result from ajax method call] doesn’t contain javascript, other then events (onclick, onblur, etc.).


Powershell Text Replace

Search a text file line by line, replacing text using regex’s.
<br />cat &lsquo;file.txt&rsquo; | foreach { $_ -replace &lsquo;find-text&rsquo;, &lsquo;replace-text&rsquo; }<br />


WIX: Skipping a dialog based on selected feature.

To skip dialogs you will need to modify the wxs files for the dialogs around your dialog. You need to add click events to the next and back buttons to handle the different paths based on the selected features.


<Publish Event=“NewDialog”
Value=“[WixUI_CustomizeDlg_NextMyFeatureDlg]”>
<![CDATA[&FeatureID = 3 AND !FeatureID <> 3]]>
</Publish>

You will also have to modify the WixUI_FeatureTree.wxs file to handle the newly created events. The default files can be copied from the WIX source.

One thing to note is the odd syntax for getting the state properities of objects.
&FeatureId is like FeatureId.ActionState
!FeatureId is like FeatureId.InstalledState

Inside the dialog…


<Control Id=“Next” Type=“PushButton”
X=“236” Y=“243” Width=“56” Height=“17”
Default=“yes” Text=“$(loc.WixUINext)”>
<Publish Event=“NewDialog”
Value=“[WixUI_CustomizeDlg_NextMyFeatureDlg]”>
<![CDATA[&FeatureID = 3 AND !FeatureID <> 3]]>
</Publish>
<Publish Event=“NewDialog”
Value=“[WixUI_CustomizeDlg_Next]”>
<![CDATA[NOT (&FeatureID = 3 AND !FeatureID <> 3)]]>
</Publish>

</Control>

References:
Wix Tutorial


ActiveRecord dictionary mapping.

<br />[HasMany(typeof(MyObject), &ldquo;object_id&rdquo;, &ldquo;objecttable&rdquo;, RelationType = RelationType.Map,<br />Cascade = ManyRelationCascadeEnum.All, CustomAccess = Generics.Access, Lazy = true,<br />Index = &ldquo;name-of-key-column-in-objecttable&rdquo;, IndexType = &ldquo;System.String&rdquo;)]<br />public IDictionary<string, MyObject> Objects {&hellip;}<br />

Castle Project :: View topic – Dictionary and RelationType.Map, Index, IndexType


Brutalist Framework