Pages

2009-10-19

Install a recent JRE as prerequisite in an InstallAware Package

I wanted to deploy a Java application as an InstallAware Package, however I wanted to provide a more recent JRE as 1.6.1 provided with IA9.

These are the steps:

1. Download the most recent JRE and place them somewhere in your project's directory (e.g.: C:\Project\FileBag). My directory contents looked like this:

  • jre-6u16-windows-i586.exe
  • jre-6u16-windows-x64.exe
2. Create a file bag inside IA:

Set Variable FILEBAG to

Define File Bag : C:\Project\FileBag\*.*, get runtime location of files into variable FILEBAG


2. Check if the OS is 32 or 64 bit:

Get System Setting Windows in 64 bit Mode into WIN_64BIT

if Variable WIN_64BIT Equals TRUE
   Set x64 - Native 64 bit Windows, AMD64 and EM64T Architectures - installation mode
end


3. Add a check for JRE in the prerequisite check section:

Read Registry Key HKLM\SOFTWARE\JavaSoft\Java Runtime Environment\1.6\JavaHome into JRE

if Variable JRE Equals
   Set Variable PREREQ to TRUE
   Set Variable PRELIST to $PRELIST$$NEWLINE$Java(TM) SE Runtime Environment 6
end

3. Add JRE installation in prerequisite installation section:
if Variable JRE Equals

   Set Variable PROGRESSTEXT to Java(TM) SE Runtime Environment 6
   Set Variable JRERES to
   Set Variable JREERR to
   Set Variable JRE_INSTALLER to



   if Variable WIN_64BIT Equals TRUE
      Set Variable JRE_INSTALLER to $FILEBAG$\jre-6u16-windows-x64.exe
   else
      Set Variable JRE_INSTALLER to $FILEBAG$\jre-6u16-windows-i586.exe
   end


   Run Program $JRE_INSTALLER$ /s /v"/qnADDLOCAL=ALL UPDATE=1 IEXPLORER=1 NETSCAPE6=1 MOZILLA=1 REBOOT=Suppress JAVAUPDATE=0 WEBSTARTICON=0 EULA=1" (WAIT, get result into variable JRERES)


   if Variable JRERES not Equals 0
       MessageBox: $TITLE$ Setup, Java(TM) SE Runtime Environment 6 installation has failed.$NEWLINE$$NEWLINE$$JREERR$$NEWLINE$$NEWLINE$$TITLE$ Setup cannot continue.
       Terminate Installation
   else
       Read Registry Key HKLM\SOFTWARE\JavaSoft\Java Runtime Environment\1.6\JavaHome into JRE


   end
end

That's it!

2009-10-17

Random Wallpaper in Gnome using wallpapoz and directory scan script

I wanted my Gnome wallpaper to switch through my picture collection randomly and also display only those pictures which are in landscape mode with an aspect ration about 16:9 or 16:10.

I didn't find anything doing it out of the box, but wallpapoz was a good start. It works fine, you can add singe pictures or directories to the configuration and even diferent sets for each workplace.

However it is boring to click thorugh a deep hierarchy of picture folders and subfolders to add pictures to the collection manually and there's still no possibility to take landscape pictures only.

So I had a look at the .wallpapoz/wallpapoz.xml file and realized how simple this file is structured. The files are listed line by line enclosed in a file tag.

Then I used the identify command line utility from ImageMagick package which prints out the pictures attributes like resolution - there I was, everything ready to write a shell script which woud go with find trough a given top level directory, execute the identify command on each image and pipe the output to awk which takes only JPEGs  with a landscape aspect ratio 16:9 - 16:10 so 1.5 to 1.8. and print everything to a temporary file.

Then the skeleton of wallpapoz.xml with the desired preferences like randomize, stretch and scale are taken and echo'ed to the STDOUT as well as the contens of the temporary file containing the file listing.

As simply as that, copy the shell script somewhere and run it like:

wallpapoz.sh > ~/.wallpapoz.xml

and restart the daemon_wallpapoz.

And this is the script:

---- cut here ---
if [ $# -lt 1 ]
then
     echo "Usage: `basename $0` directory\ containing\ images OR"
     echo "Usage: `basename $0` \"directory containing\images\""
     exit 1
fi
TEMPFILE=/tmp/wallpapoz.tmp.$$
find "$*" -type f -exec identify {} \; 2>/dev/null \
| awk -F'JPEG|x' '
{
        if(NF==4) {
                split($3,arr," ");
                if(arr[2]>arr[1]) {
                        ratio = arr[2]/arr[1];
                        if(ratio>1.5 && ratio <1.8) {
                                print $1;
                        }
                }
        }
}' \
| sed "s/ *$//g"|sed "s/^.*$/      <file><\/file>/g" > $TEMPFILE
echo '<?xml version="1.0" encoding="utf-8"?>'
echo '<!DOCTYPE Wallpapoz>'
echo '<wallpapoz interval="2" random="1" style="1" type="workspace">'
echo '    <workspace name="Umbenennen" no="1">'
cat $TEMPFILE
echo '   </workspace>'
echo '    <workspace name="Umbenennen" no="2">'
cat $TEMPFILE
echo '    </workspace>'
echo '    <workspace name="Umbenennen" no="3">'
cat $TEMPFILE
echo '    </workspace>'
echo '    <workspace name="Umbenennen" no="4">'
cat $TEMPFILE
echo '    </workspace>'
echo '</wallpapoz>'
rm $TEMPFILE

---- cut here ---


That's it!

2009-10-08

Enable BitLocker without TPM chip in Windows 7

In order to encrypt your drives with Bitlocker in Windows 7 without TPM chip you need to choose an alternative way to pass the authentication, e.g. saving the key on a USB thumb drive.

Run gpedit.msc in Administrator mode and navigate to Local Computer Policy -> Computer Configuration ->  Administrative Templates -> Windows Components ->  BitLocker Drive Encryption -> Operationg System Drives 

"Require additional authentication at startup" to "Enabled"

Proceed with BitLocker encryption in the Control Panel.

That's it.

2009-10-07

Don't display user name on a locked computer in Windows Vista/7

To make Windows Vista and Windows 7 not show the name of the logged on user on a locked workstation (e.g. to improve the security on your box), you have to set the corresponding local group policy.


Run secpol.msc in Administrator mode and navigate to Security Settings -> Local Policies -> Security Options and set the policy:

"Interactive logon: Display user information when the session is locked" to "Do not display user information"

That's it.

2009-10-06

Start HDDLifePro minimized using VBS

I've ran recently in a Pro version of HDDLife from a magazine and it appeared pretty handy for me. The program shows  (when started and minimized) the current HDD temperature in the tray.

There's an option to run it on Windows start, however there's no option to start it minimized.

This can be solved with a small VB script like this:


Set WshShell = WScript.CreateObject("Wscript.Shell")
WshShell.Run """C:\Program Files (x86)\zoneLINK\HDDlife\HDDlifePro.exe""", 7 ,True


I enclosed the binary path with three double quotes because of the parenthesis in the path (x86) and chose startup mode 6 (minimized).

Detailed information for Shell.Run() is documented on MSDN



Just add a shortcut to this script to the Startup folder in the start menu.

That's it!

2009-10-03

Start Nautilus with Windows + E keyboard shortcut

To get nautilus to popup by keyboard combination WINKEY + E like Windows Explorer in Windows you need to do the following:

1. run gconf-editor
2. navigate to apps -> metacity -> global_keybindings
3. set key run_command_1 to e
4. navigate to apps -> metacity -> keybinding_commands
5. set key command_1 to nautilus
6. close gconf-editor
7. Hit WINKEY + E and nautilus will pop up

That's it!