NAME

Tk::Wizard::Installer::Win32 - Win32-specific routines for Tk::Wizard::Installer

DESCRIPTION

All the methods and means of Tk::Wizard, plus those below:

METHOD register_with_windows

Registers an application with Windows so that it can be Uninstalled using the Add/Remove Programs dialogue.

An entry is created in the Windows' registry pointing to the uninstall script path. See uninstall_string, below.

Returns undef on failure, 1 on success.

Aguments are:

display_name =>

The string displayed in bold in the Add/Remove Programs dialogue.

display_version =>

Optional: the version number displayed in the Add/Remove Programs dialogue.

uninstall_key_name

The name of the registery sub-key to be used.

uninstall_string

The command-line to execute to uninstall the script.

According to Microsoft:

You must supply complete names for both the DisplayName and UninstallString
values for your uninstall program to appear in the Add/Remove Programs
utility. The path you supply to Uninstall-String must be the complete
command line used to carry out your uninstall program. The command line you
supply should carry out the uninstall program directly rather than from a
batch file or subprocess.

The default value is:

perl -e '$args->{app_path} -u'

This default assumes you have set the argument app_path, and that it checks and reacts to the the command line switch -u:

package MyInstaller;
use strict;
use Tk::Wizard;
if ($ARGV[0] =~ /^-*u$/i){
	# ... Have been passed the uninstall switch: uninstall myself now ...
}
# ...

Or something like that.

Note: this method uses eval to require Win32::TieRegistry.

This method returns 1 and does nothing on non-MSWin32 platforms.

ACTION EVENT HANDLERS

A Wizard is a series of pages that gather information and perform tasks based upon that information. Navigated through the pages is via Back and Next buttons, as well as Help, Cancel and Finish buttons.

In the Tk::Wizard implimentation, each button has associated with it one or more action event handlers, supplied as code-references executed before, during and/or after the button press.

The handler code should return a Boolean value, signifying whether the remainder of the action should continue. If a false value is returned, execution of the event handler halts.

-preNextButtonAction =>

This is a reference to a function that will be dispatched before the Next button is processed.

-postNextButtonAction =>

This is a reference to a function that will be dispatched after the Next button is processed.

-preBackButtonAction =>

This is a reference to a function that will be dispatched before the Previous button is processed.

-postBackButtonAction =>

This is a reference to a function that will be dispatched after the Previous button is processed.

-preHelpButtonAction =>

This is a reference to a function that will be dispatched before the Help button is processed.

-helpButtonAction =>

This is a reference to a function that will be dispatched to handle the Help button action.

-postHelpButtonAction =>

This is a reference to a function that will be dispatched after the Help button is processed.

-finishButtonAction =>

This is a reference to a funciton that will be dispatched to handle the Finish button action.

-postFinishButtonAction =>

This is a reference to a function that will be dispatched after the Finish button is processed.

-preCancelButtonAction =>

This is a reference to a function that will be dispatched before the Cancel button is processed. Default is to exit on user confirmation - see "METHOD DIALOGUE_really_quit".

-preCloseWindowAction =>

This is a reference to a funciton that will be dispatched before the window is issued a close command. Default is to exit on user confirmation - see "DIALOGUE METHOD DIALOGUE_really_quit".

All active event handlers can be set at construction or using configure - see "WIDGET-SPECIFIC OPTIONS" and "METHOD configure".

BUTTONS

backButton nextButton helpButton cancelButton

If you must, you can access the Wizard's button through the object fields listed above, each of which represents a Tk::BUtton object.

This is not advised for anything other than disabling or re-enabling the display status of the buttons, as the -command switch is used by the Wizard:

$wizard->{backButton}->configure( -state => "disabled" )

Note: the Finish button is simply the nextButton with the label $LABEL{FINISH}.

See also INTERNATIONALISATION.

INTERNATIONALISATION

The labels of the buttons can be changed (perhaps into a language other an English) by changing the values of the package-global %LABELS hash, where keys are BACK, NEXT, CANCEL, HELP, and FINISH.

The text of the licence agreement page and callbacks can also be changed via the %LABELS hash: see the top of the source code for details.

CAVEATS / BUGS / TODO

  • In Windows, with the system font set to > 96 dpi (via Display Properties / Settings / Advanced / General / Display / Font Size), the Wizard will not display propertly. This seems to be a Tk feature.

  • Still not much of a Tk widget inheritance - any pointers welcome.

  • Nothing is currently done to ensure text fits into the window - it is currently up to the client to make frames Scrolled), as I'm having problems making &blank_frame produce them.

CHANGES

Please see the file CHANGES.txt included with the distribution.

AUTHOR

Lee Goddard (lgoddard@cpan.org) based on work Daniel T Hable.

KEYWORDS

Wizard; set-up; setup; installer; uninstaller; install; uninstall; Tk; GUI.

COPYRIGHT

Copyright (c) Daniel T Hable, 2/2002.

Modifications Copyright (C) Lee Goddard, 11/2002 ff.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

THIS SOFTWARE AND THE AUTHORS OF THIS SOFTWARE ARE IN NO WAY CONNECTED TO THE MICROSOFT CORP. THIS SOFTWARE IS NOT ENDORSED BY THE MICROSOFT CORP MICROSOFT IS A REGISTERED TRADEMARK OF MICROSOFT CROP.