Sunday, December 6, 2009
Saturday, September 5, 2009
Wednesday, September 2, 2009
Tuesday, September 1, 2009
Thursday, August 20, 2009
You remember the Selemium IDE and its recorder that simplify the way we create tests. Recently I found one new great product which will make .NET system testing even easier.
ArtofTest has released new web testing framework WebAII which gives great abilities for testing different browsers by creating complicated tests right into our visual studio IDE. It can even test Silverlight. I am very exited to go forward with it and post more detail review about this great technology. Meanwhile you can download it from www.artoftest.com and watch video tutorials here
Sunday, April 26, 2009
Download and compile the fck editor for .net project.
Dowlnload and place the scripts folder fckeditor in the root directory. If you want to place it in subfolder you need to change the path to resources (config file).
After that you need to reference the FCK assembly and you can use it on the page:
<%@ Register Assembly="FredCK.FCKeditorV2" Namespace="FredCK.FCKeditorV2" TagPrefix="FCKeditorV2" %>
<fckeditorv2:fckeditor id="FCKeditorExample" runat="server"/>
And we are ready to go:
Enjoy the Power of FCKEditor.
Tuesday, March 24, 2009
In this article we will get familiar how to create custom installer for non .NET based application using Visual Studio Setup project technology.
It is known that Setup project in VS 2005/2008 gives way to easy creation of msi installer for your .NET application, automatically detect decencies, execute custom actions, etc. In this post I will show one unusual case where this technology can be used – creating installer for Java application. There are steps in this task:
- Ensure that correct version of Java is installed on the machine and install Java if needed
- Copy the application in the chosen folder and create shortcut to the desktop.
- Check the target machine for Java installed and install Java if needed – way 1
First we need to check if our machine has installed the correct version of JRE. In our case we will check if Java version 1.6 is installed on the machine. To do this we will check target machine registry records. First let’s see what .NET offers us. We can use the Section Launch conditions in our Setup project to check the registry:
Go to launch condition section, right click on the Search Target Machine and add Search registry node. Then set its properties to search the current Java version. The key we are looking for is HKEY_LOCAL_MACHINE\SOFTWARE\JAVASOFT\JAVA RUNTIME ENVIRONMENT /CURRENTVERSION.
Next we can add Launch condition. We add condition for java version based on the found registry entry. We are looking for Java 1.6 or higher. We specify the error message and the installation URL.
This is some way to deal with the situation but it does not actually installs JRE rather than preventing program install if the requirement are not satisfied. If you run this installer on machine without Java you will need to manually install the JRE after its installation is complete.
- Check the target machine for Java installed and install Java if needed – way 2
The second way is to use one of the benefits of the setup projects – creating custom action. It allows you to trigger event during installation. Here we can call the installer directly by selecting the path to the .exe. We can add condition to start this exe and again we will use search result from registry search “JAVAVERSION” from the previous example.
We can add the desired file in our project through the file system editor and then executed it as a custom action. Everything seems quite simple, but wait, there is a catch – JRE 1.6 is MSI installer. That means that you cannot run it while our MSI is running. As a result we can use this approach when we are running non-MSI installers. So what to do then?
- Check the target machine for Java installed and install Java if needed – way 3
What if we have MSI installer, containing software that is vital for our program? The decision is called prerequisites. As we know when we add .NET project output in Setup project it automatically detect its dependencies and add them as prerequisite. So, we will use this mechanism to add Java as prerequisite. We can view the current project prerequisites from Project -> Properties -> Prerequisites. Currently only .NET Framework and Windows installer will be selected. We will deselect them, since our project will not .NET. If we look at the list we won’t find JAVA as prerequisite (what a surprise :). But we can add it. All we need is to create package manifest. For this we will need Bootstrapper Manifest generator. The one for VS 2008 can be found here. So, after installation we open it and choose New -> Package Manifest.
Next we name the project.
After that we can add the file for Java installation from the top-left file – the installer icon. Next we choose the install file we need to add.
After that we need to add the system registry check. We choose System check tab and add new registry check. We will search for the same registry record as before.
Then we add display name of the install file is its settings. We name it Java. And the package is ready. There are also many other settings that can be set. Check whether folder named Java is located in C:\Program Files\Microsoft SDKs\Windows\v6.0A\Bootstrapper\.
And now we go back to Prerequisites menu of our project we will se that our Java is in the list. Check it and select the second option from the radio button list. That way your these installations will be copied in the output directory.
Now we can add the Java application file in the application folder and finish installation as it is .NET based.
One more thing, creating the desktop shortcut mechanism is not obvious – creating new shortcut directly in the folder gives you only option to choose folder. To create shortcut to your file you need to right click on your file and choose create shortcut. Then you can move it to the desktop.
In this we saw several ways to extend the ability for creating flexible installer. This approach is not limited to Java or .NET applications but can be used on other technologies as well.