Tuesday, June 22, 2010

WIX Patch: replace keypath and restart service

I need to create a small update (patch) for my application. I have large application with about 2000 of files. Source project comprises 13 wxs files. A file list is generated by the "heat" command. So, each file is represented as a single component and become a key path (key file) for the component.
During the update I want to replace one dll which is used by a service. So, I have to stop the service, replace the dll and start the service.
After few days of investigation I found out the following:
There are at least two options for patch creation using WIX:
1. Using Purely WiX
2. Using Patch Creation Properties

I prefered the first one.

Commands for the patch creation are discribed in the link above. I did the following:
1. Modify the component for the file to be replaced:
originally was:
<Component Id="cmp1000" Guid="GUID">
<File Id="file1000" KeyPath="yes" Source="$(var.Root)\File.dll" />
</Component>

change to:
<Component Id="cmp1000" Guid="GUID">
<ServiceControl Id='StopServicePatch' Name='ServiceName' Stop='install'/>
<File Id="file1000" KeyPath="yes" Source="{new path}\File.dll" />
<ServiceControl Id='StartServicePatch' Name='ServiceName' Start='install'/>
</Component>
The source file path has been changed as well as ServiceControl actions are added.
2. Build two msi files with the same name
3. Create msp patch file

But if you now run the patch by double clicking on the .msp file, it does not work as expected - it runs UI and asks to choose option for the original application - modify, repair or remove.
4. To install the patch run the following command line:
msiexec /p patch.msp LIMITUI=1 REINSTALLMODE=emus

setting the LIMITUI property restricts UI and the patch is installed without displaying any dialog windows.
the REINSTALLMODE specifies type of reinstallation to be performed. By default the REINSTALLMODE is "omus", but in this case my dll is not replaced as it has the same version number. So, I changed property to "emus" and now the dll is replaced by the patch.

in the log file of the patch installation I see the file is repalced:
Patch Modified Files List:
MSI (s) (A4:64) [15:38:51:275]: File = file1000: Final State = Install
...
File: C:\Program Files (x86)\MyApp\File.dll; Overwrite; Won't patch; Existing file is of an equal version

Tuesday, June 15, 2010

Windows XP: Error parsing the server "IP" "clients.xml" file

I'm running Windows XP and using vSphere for about half a year. After update installation for my Windows XP, got the following error when log in to the vSphere by the client:
Error parsing the server "SERVER IP" "clients.xml" file. Login will continue, contact your system administrator.

I pressed OK and got another error:
The type initializer for "VirtualInfrastructure.Utils.HttpWebRequestProxy" threw an exception

I've googled for the error message and found a lot of articles about the error on Windows 7.
Finally, I've found the solution on the support vmware site for Windows XP and others :)

You cannot use vSphere Clients prior to the Update 1 release, to access the vCenter Server or ESX hosts because of a Microsoft update that targets the .NET Framework (980773), released on June 9th 2010

Perform one of these two options to correct the issue:
  1. Download and install vSphere Client 4.0 Update 1 (build 208111) or Update 2 (build 258672) using method.
  2. Remove the MS update from your Windows operating system. The vSphere Client works after the update is removed.

Thursday, June 10, 2010

Gradual Site Delete: Gradual deletion of site collection in SharePoint 2010

When you delete a Site collection in SharePoint 2010 from Central Administration or from the site collection settings it is deleted gradually.
The gradual deletion is performed by the Timer Job Definition called Gradual Site Delete.
In few words:
The site reference is being deleted from SiteMap and Sites tables of configuration and content databases and added into the SiteDeletion table. The Site collection is unavalaible for users. But sub-sites still exist in the Webs table of content database. This behavior can cause some issues for third-party tools which read these tables.
The Gradual Site Delete Timer Job definition is scheduled to be runnin one time a day. It can be started manually from Central Administration -> Monitoring -> Review job definitions -> Gradual Site Delete.
Here you can edit the timer job or run the job immediately

Refer the following article for more detailed information about the Gradual Site Delete timer job definition.

To delete the site collection completely use the following Powershell command:
Remove-SPSite -Identity ""

Tuesday, June 8, 2010

Reduce software installation time

In MSI 5 there’s a new property MSIFASTINSTALL that can be set on the command line or in the Property table to speed up large install packages. It’s a combination of flags that will avoid creation of a system restore point, skip some costing tasks, reduce the frequency of progress messages, or any combination of these.
http://www.verboon.info/index.php/2009/07/reduce-software-installation-time/