Windows Vista – Folder Winsxs?

When I started to use Vista I did know why my hard disk is always more than 50% full after some months. So I used TuneUp Disk Space Explorer to find out which folder occupies so much disk space and at last I found a strange folder which is very big. Its size is about 7 GB and gets bigger and bigger day by day. It is winsxs folder.

For more details about winsxs folder you can find at The Secret of Vista Winsxs folder . As I saw this result I thought it is a real folder. But today I found another article which states that.

“Modularizing” the operating system was an engineering goal in Windows Vista. This was to solve a number of issues in legacy Windows related to installation, servicing and reliability. The Windows SxS directory represents the “installation and servicing state” of all system components. But in reality it doesn’t actually consume as much disk space as it appears when using the built-in tools (DIR and Explorer) to measure disk space used. The fact that we make it tricky for you to know how much space is actually consumed in a directory is definitely a fair point!

In practice, nearly every file in the WinSxS directory is a “hard link” to the physical files elsewhere on the system—meaning that the files are not actually in this directory. For instance in the WinSxS there might be a file called advapi32.dll that takes up >700K however what’s being reported is a hard link to the actual file that lives in the Windows\System32, and it will be counted twice (or more) when simply looking at the individual directories from Windows Explorer.

So the winsxs just contains links to real file. Anyway if you install more softwares on your computer, this folder will get bigger too because more files will be saved at your machine to let multiple applications run in Windows without any compatibility problem.

UPDATE 07.03.2014
– After installing Service Pack (SP) for your windows, the WinSxS folder will get again bigger because he has to make a backup of old assemblies. When Service Pack works fine, you can remove all installation and back up files of SP by executing this command (under administrator permission)

dism /online /cleanup-image /spsuperseded /hidesp

– The option is also available in Disk Cleanup

Disk Cleanup

– Choose Clean up system files

Clean up system files

– Choose Windows Update Cleanup and Windows upgrade log files

Windows update cleanup

– Then clean them up

PHP – How to use curl to get content of a website?

As I developed my own small applications with Silverlight, I have difficulties with Cross-Site-Domain access. Because of preventing potential networking threats to be mitigated include:

  • Denial of Service (DoS) attacks – A large number of remote hosts are used to attack a target site sothat the target is unable to service valid requests.
  • DNS Rebinding attacks – Use DNS to force a remote host to rebind a trusted host name (site oforigin) to a victim’s IP address, thus allowing access to a host other than site of origin.
  • Reverse tunnel attack – Use a remote client’s outgoing connection as a back tunnel to the client’sprivate network

Continue reading PHP – How to use curl to get content of a website?

C# – How to read data from .msi file?

Today I start a new small project on extracting file from .msi file. The reason I start this project is that sometimes I just want to run a program only once but it needs to install on my machine. I do not like that. For example, I would like to check if my computer is suitable for Windows 7 so I downloaded Windows 7 Upgrade Advisor and run it to test. After finising with download, I realized that it is a .msi file. That means I must install if I would like to use. So I search around to find an unpacker for MSI file but after some searching I decide to write my own one. I guess it is not so difficult to write a program to extract all files in .msi file.

In my first step, I searched for MSI file format specification but after hard searching in 30 minutes, I could not find any documenation about msi file format. I really hate Microsoft in some cases. Microsoft did not publish any documentation of some important file formats and protocols which they use in Windows. Before I have problem with MMS protocol and now with MSI, always no specification for them. :(. I thought I could not start my project because it is not easy to reverse a file format of a complex structure. Luckily Wikipedia leads me to a WIX.

The Windows Installer XML toolset, is a free software toolset that builds Windows Installer (MSI) packages from an XML document. It supports a command-line environment that developers may integrate into their build processes to build MSI and MSM setup packages. WiX was the first software released by Microsoft under an open-source license called Common Public License.

For more details, you can find at homepage of Wix. I just post below a small code snippet to access info from msi file.


string strFileMsi = "D:\\w7ua.msi";
string strFileMsiNameOnly = Path.GetFileNameWithoutExtension(strFileMsi);
string strDirectory = Path.GetDirectoryName(strFileMsi);
Database dbMsiFile = new Database(strFileMsi, OpenDatabase.ReadOnly);
View viewTemp = dbMsiFile.OpenExecuteView("SELECT * FROM Media");
Record rcTemp = viewTemp.Fetch();
string strCabsName = rcTemp[CNST_MEDIA_CABINET];
Console.WriteLine(strCabsName);
strCabsName = strCabsName.Substring(1);
viewTemp = dbMsiFile.OpenExecuteView("SELECT * FROM `_Streams` WHERE `Name` = '" + strCabsName + "'");
rcTemp = viewTemp.Fetch();

To view all available tables from msi file you can use Orca tool which is shipped with Windows Installer 4.5 SDK as figure below.

C#, Sharepoint – Send appointment without using Outlook Object

Two months ago I wrote a small blog about my new project on creating a  SharePoint Webpart for sending appointment. Today a reader asks me how I solve my task at sending appointment without using Outlook Object so I decide to publish my code for sharing with who needs it. In this project I should create a Webpart to send Outlook appointment without using the available Outlook Object. The using of Outlook Object will require that man must install Microsoft Outlook in server and this installation is not worth for supporting only a small Webpart. Therefore in my code I only use classes provided by .Net Framework and do not use any Outlook Object.

Continue reading C#, Sharepoint – Send appointment without using Outlook Object