Posts Tagged ‘portableapps’

h1

A portable web server where I want it

13/07/2009

I’ve been tinkering recently with some things around portable applications which I will probably post more about in the hopefully not too distant future.  One of the things I’ve been trawling around for and busily configuring are various free web server packages that are “portable”.  Unfortuately it has taken a fair bit of effort to actually track down and configure something that is portable enough.   The problem for me is that I have a particular need to locate the web server within a particular sub folder and in the case of most software packages this is not an option.

Most implementations are based around Apache (e.g. micro apache, XAMPP, TWAMP, WAMP, USB Web Server) but there are a few other options out there I also looked at  such as RITlabs TinyWeb.  Some of these experience problems when they are not installed to the root of a drive and others have a problem when the installation path contains spaces.  My desired installation path unfortunately is not in the root folder and does contain spaces which ruled out most of the options.

I found two options that did seem to cope with the path.  These were WAMP and USB Web Server.  My preference is for USB Web Server and I’ll explain why…

When installed my WAMP system tray application did not match up to the one shown on the web site.  Even though it was running, the status told me that it wasn’t and there was no option to stop/start individual applications such as Apache and MySQL.  Moreover WAMP comes as an installation package which adds an entry into the registry – at least for the add/remove software entry … which seems blatantly false for something that is supposed to be portable.

USB Web Server on the other hand does work as expected and does allow me to stop and start specific web related services and even to move it to a different folder (you have to close it in between).  The one thing I would like is to be able to specify which web services it should run at start-up.  It runs Apache, MySQL and SMTP by default, but I’d really just like to run Apache and free up my RAM without specifically having to manually turn them off.  I tried various renames of folders and changing of settings, but everything I tried either had no effect or stopped Apache running as well.  I’m guessing that there’s some sort of start-up chain at work rather than independent requests.  But maybe someone else knows what to change to address this or perhaps the developer will provide this option in a future release.

So if you want a truly portable web server try USB Web Server.

Advertisements
h1

AutoHotKey – Portable Drive Menu

21/02/2009

I’m a big fan of portable applications and particularly the work driven by PortableApps.com.  The PortableApps Menu has been undergoing a revamp for some time now to work towards a number of enhancements and in the mean time I’ve taken up using a branch of this known as Geek Menu.  Unfortunately they are all quite slow as I have a huge number of portable applications on my portable hard drive.

I usually have a small number of applications I use regularly and so I actually want a fast loading light menu for automatic loading and then I load Geek Menu from that should I need access to lots of applications or ones that I use infrequently.

I’ve created a basic little application menu using AutoHotKey that is driven from a simple INI file menu system (that you manually edit) to fill this need.  When run it sits in the system tray and when you click on it it displays a set of menu items (including sub menus) and executes the item associated with it using the path for it in the INI file.

The script for this is as follows:

; Copyright flagit.wordpress.com 2009
;;;;;;;;;;;;;
;MAIN SCRIPT;
;;;;;;;;;;;;;

;;;;;;;;;;;;
;Initialise;
;;;;;;;;;;;;
#Persistent
#SingleInstance

AppName = PUMAS
AppIni = %A_ScriptDir%pumas.ini
IconFile = %A_ScriptDir%pumas.ico

;;;;;;;;;;;;
;Build Menu;
;;;;;;;;;;;;
;Set-up Base Menu Settings
menu, tray, Icon, %IconFile%
menu, tray, tip, %AppName%
menu, tray, nostandard
menu, tray, add, %AppName%, Heading
menu, tray, Default, %AppName%
menu, tray, disable, %AppName%
menu, tray, click, 1
menu, tray, add ; separator

;Build the base menu
BuildMenu("Tray", AppIni)

;Exit app entry
menu, tray, add ; separator
menu, tray, add, Exit, ExitApplication
return

;;;;;;;;;;;
;FUNCTIONS;
;;;;;;;;;;;

;Recursive function to build the menu
BuildMenu(MenuSection, INIFile)
{
    ;Build menus from INI file
    Counter=1
    Loop
    {
        IniRead, MenuEntry, %INIFile%, %MenuSection%, Item%Counter%, *
        If (MenuEntry="*")
            Break
        IniRead, MenuEntryPath, %INIFile%, %MenuSection%, %MenuEntry%, *
        If (MenuEntryPath="*")
        {
            BuildMenu(MenuEntry, INIFile)
            menu, %MenuSection%, add, %MenuEntry%, :%MenuEntry%
        }
        Else
        {
            menu, %MenuSection%, add, %MenuEntry%, ExecuteItem
        }
        Counter += 1
    }
}

;;;;;;;;;;;;;;;;;
;MENU PROCESSING;
;;;;;;;;;;;;;;;;;

;The heading is disabled and simply allows the left click to produce
;the right click context menu
Heading:
menu, tray, show
return

;Open the specified path for the menu item generated from the INI file
ExecuteItem:
;Open the item specified for this in the ini file
IniRead, MenuEntryPath, %AppIni%, %A_ThisMenu%, %A_ThisMenuItem%
SplitPath, A_ScriptDir, , , , , ScriptDrive
Run, %ScriptDrive%%MenuEntryPath%
return

;Close the application
ExitApplication:
ExitApp

There are a few variables in the initialise section that specify the name of the application, the INI file that defines the menu (which is convenient to store in the same folder as the menu script/executable and the icon file for the application.

The INI file has a “Tray” section which defines the root content of the tray item’s context menu.  Each item is specified by “Item#” in numeric order.  Each item specified will either have an entry in the same section (making it an item for execution) or a section of the same name (indicating it is a sub-menu).

An example menu might look something like:


[Tray]
Item1=Utilities
Item2=Tools
Item3=Help

Help=Helppumas.chm

[Utilities]
Item1=Defrag
Item2=Format Floppy

Defrag=File HelpersUnfrag.exe
Format Floppy=batchformatFD.bat

[Tools]
Item1=Tools Guide
Item2=Mega Kit

Tools Guide=ToolsGuide.doc
Mega Kit=Toolsmegakit.exe

This produces a menu system with two sub menus (one for utilities and one for tools) each with two items and a help item on the root menu.  This configuration file specifies all paths in relation to the root of the drive it is stored on.  You can tailor this INI file to your needs and even the menu system itself by modifying the script to what you want – just recompile it with the AutoHotKey compilation tool and you’ve got it.