Wednesday, April 28, 2010

Deploying Custom made Visual Studio prerequisites using Bootstrapper Manifest Generator

Do you want your setup installer install Software 'X' before the actual program is installed, using Visual Studio Development?

The Software 'X' is called a prerequisite and can be Java Run Time, DirectX, 3rd party plugin installation etc.

Checker >> There are in-built prerequisite supported by Visual Studio. Open a Setup and Deployment project in Visual Studio... From the menu, select Project >> Properties...; or Hit Alt + F7.

Select Prerequisites...

Now, you would see a list of prerequisites listed here.

You can add a custom prerequisite of your choice. Here is how to do it,

Things to download:
1) Bootstrapper Manifest Generator (BMG)

Click here to download.

2) I want to create a prerequisite fir Visual J# 2.0. I have downloaded the required setup files for 32-bit and 64-bit.

32-bit
64-bit

Instructions:
1) Install BMG, Visual J# 32-bit and 64-bit.

2) Open BMG, create a new file. Select Package Manifest...

3) Rename the Product name, Product Code to Visual J

4) I have to install the particular version of Visual J# based on the OS bit version and if it is installed. To accomplish this, I have made some Install checks and OS checks. Please read about registry checks if you need to install software based on the existing version.

Select the System Checks tab and select the MSI product check... As you have already installed the 32-bit and 64-bit Visual J#, you will find them in this list. Name them with a property which you will be using in future.

5) Add Install File... Browser to the downloaded Visual J# 32-bit and 64-bit .exe files.
Select vjredist.exe. Rename the Display Name. Select Install Conditions...

Add these two conditions...
BypassIf >> ProcessorArchitecture = AMD64
BypassIf >> VJInstall > 2


this means you want to skip this installer if the OS is 64 bit and Visual J is already installed (> 2).

Select the Exit Codes and set them..
0 >> Success
1641 >> Success, Reboot Needed
3010 >> Success, Reboot Needed

Similarly select conditions for vjredist64.exe

Add these two conditions...
BypassIf >> ProcessorArchitecture = AMD64
BypassIf >> VJInstall > 2

Set the same Exit Codes as before..

6) Save and the Package Manifest file and build it...

7) Go to Document and you will find a folder named Visual J. Copy this folder to C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bootstrapper\Packages .

8) Repeat Checker and now you will find the Visual J here. Select it. Uninstall Visual J# 32 - bit and 64 - bit. Trying running the setup file after you compile your Visual Studio project. The installer detects you do not have Visual J and gives your an option to install.

Cheers.

Tuesday, April 27, 2010

Location Bar searches from Google.com @ Firefox

You can search for a string from the Location bar in Mozilla Firefox, like Google Chrome. Here is how to do it...

1) Open Firefox

2) Type about:config in the Location bar.

3) In the Filter box, search for Keyword.URL

4) Doulbe-Click it and you can edit it. Type http://www.google.com/search?q=

5) Hit OK and you are done. Now you can search from the Location bar in Google.

Cheers.

Monday, April 26, 2010

Android SDK, Eclipse and Ubuntu (Linux)

This tutorial shows installation of Android SDK on Eclipse 3.5.1 @Ubuntu 9.10.

Things needed:
1) Latest version eclipse. Can download from Eclipse Downloads. Any version is fine.

From Terminal:
sudo apt-get install eclipse
2) Latest version Java SDK. Click here for Sun Java Downloads. We require Java Development Kit and Java Run Time.

From Terminal:
sudo apt-get install sun-java6-jdk sun-java6-jre sun-java6-plugin
3) Download the latest Android SDK, appropriate for you. In our case, it is Linux i386. Save the tar file to your Desktop. Extracting it will create a folder with name 'android-sdk_r05-linux_86'.

Instructions:
1) Before we start the process, lets upgrade and update all the packages.

From Terminal:
sudo apt-get upgrade
sudo apt-get update
2) Now, you have all your applications updated. Next, we need to place the Android SDK to a location where the compiler can look at. I am going to copy the folder 'android-sdk_r05-linux_86' to 'usr/local/' folder.

Go to the Desktop location:
uday@pricksaw:~$ cd Desktop

Then, copy the folder to '/usr/local'
uday@pricksaw:~/Desktop$ sudo cp -r android-sdk-linux_86 /usr/local
Check the PATH variable has the location /usr/local/
echo $PATH
3)Now, you have access to Sun JDK. Android gives additional support to Eclipse via ADT plugin. We need to install the plugin for better functionality.

Open Eclipse, Applications >> Programming >> Eclipse
From the Help Menu >> Install New Software...,
Add the Android ADT site location, 'https://dl-ssl.google.com/android/eclipse/'
Go ahead and install them.

4) You need to link the Android SDK to Eclipse.
On Windows Menu >> Preferences... ; you would see the Option for Android >> SDK Location.

Browse to the location where you copied your SDK; in our case usr/local/

Have a look at the image...

Hit Apply and OK.

5)Select the SDKs you need from Windows >> Android SDK and AVD Manager.

Go to Available Packages...
Select the
latest SDK Plaform Android (API 7)
latest Android SDK Tools (revision 5)
latest Samples for SDK API (API 7)
latest Documentation for Android SDK (API 7)

Here is an image of installed components...

Create a Virtual Device...
Select the Virtual Devices under Android SDK and AVD Manager
Select New...

Add details as shown in the picture below... you can customize the name of the device.
Now, Click create AVD.

6) Now, we are all set to start a project.

File >> Other...

Android >> Android Project...