Sajo Jacob

I am back blogging, almost 2 years after I decided to abandon my good ol C/C++ blog, so here goes my ramblings...
in

December 2007 - Posts

How to customize the install directory dynamically in WiX?

This is one of those elusive topics whose answer is hard to find with googling around, but you will discover that it’s pretty easy, again if only you knew the magic words.

 

Define this in your Main.wxs:

<Property Id="_BrowseProperty" Value="INSTALLDIR" />

 

<Directory Id="ProgramFilesFolder" SourceName="program files">

                        <Directory Id="INSTALLDIR" Name=".">

                                                <Directory Id="FOOBAR_DIR" Name="FOOBAR">

                                           <!-- All your components goes here…… -->

                                                < /Directory >

                          < /Directory >

< /Directory >

 

Define the Ok (pushbutton) and PathEdit controls in your Browse.wxs dialog for browsing directories to specify the install path as:

<Control Id="PathEdit" Type="PathEdit" X="84" Y="202" Width="261" Height="20" Property="_BrowseProperty" Indirect="yes" />

<Control Id="OK" Type="PushButton" X="304" Y="243" Width="56" Height="17" Default="yes" Text="[ButtonText_OK]">

          <Publish Event="SetTargetPath" Value="[_BrowseProperty]"><![CDATA[1]]></Publish>

          <Publish Event="EndDialog" Value="Return"><![CDATA[1]]></Publish>

 </Control>

 

And finally wire up the events in the Next button in the Customize.wxs Dialog which spawns the Browse.wxs dialog: 

<Control Id="Next" Type="PushButton" X="330" Y="308" Width="56" Height="17" Default="yes" Text="[ButtonText_Next]">

    <Publish Event="SetTargetPath" Value="INSTALLDIR"><![CDATA[1]]></Publish>

    <Publish Event="NewDialog" Value="NextDlg"><![CDATA[1]]></Publish>

    <Subscribe Event="SelectionNoItems" Attribute="Enabled" />

</Control>

                             

So how did this really work?

So as we can see INSTALLDIR is currently setup as “C:\Program Files\” (note the parent of “INSTALLDIR” is “Program Files”) but defining the INSTALLDIR with a Name attribute = “.” simply ignores the root parent folder if it finds INSTALLDIR was assigned a different value which we do in Browse.wxs dialog and uses the newly assigned install path.

 

 

I have no clue!

 

 

You will know why I chose that caption by the time you reach the end of this post.

So this week turned out to be an "interesting" week, besides getting bashed badly at Foos by my colleagues, something blew my fuse off and I didn’t know what really hit me for a little bit….

 

Like most outlook users/consultants, I try to take extra care before sending out emails, do the usual proof reading, double check the attachments and recipients. Besides that I also have a rule setup on my Outlook to defer my outgoing mail by 2 minutes so that I have enough time to catch last minute errors and avoid any possible embarrassment...

Well sadly none of those practices helped in this case.

Before I go any further, for those of who don't know how to defer your emails, here is how to do it

 

Tools>Rules and Alerts > New Rule

 

1 

 

Click Next...

2

 

Click on "a number of" and select the number of minutes by which you want to defer your outgoing mail...

3

 

So this basically keeps your outgoing mail in the Outbox for 2 minutes before sending it. It does help!

 

I always liked the Outlook-SharePoint integration with shared documents since you can preview the shared documents on your SharePoint site right from your Outlook and you don't have to download different versions as someone makes changes to it.

I found this feature to be very useful during the first couple of weeks after a new project is kicked off and the project docs are frequently updated.

 

What went wrong with the Outlook-SharePoint Discussion board integration?

For those of whom haven't used this feature yet, here is couple of ways you can connect to your SharePoint discussion board with Outlook.

 

1) Directly from your sharepoint site: Go to the discussion board and click on Actions and select "Connect to Outlook"

5

2) If you have subscribed to e-mail notifications by using the "Alert Me" option above then you will find the following option to connect to the discussion board as a header on your notification email in Outlook

4

 

Now if I were to say that an email correspondence (infact a personal email) became a discussion post on our SharePoint site sending out notifications with the email content to everyone in the office who subscribed to the alerts without my knowledge, Would that make it any interesting? Now I seem to have an audience here…

You always find comfort in the statement "It could have been worse"...I totally agree!

 

How did this happen?

Not quite sure, but here is one possibility:

 

Once connected to your Outlook, the sharepoint discussion folders appears under the root Sharepoint lists. Drag and drop of messages from your inbox to the sharepoint discussion folder will automatically create SharePoint Discussion posts without any prompts.

Scary part is: I am 95% confident I didn't do a drag and drop!