Hi,

The simplest and most effective way to do what you require would be to prepare an InnoSetup installer.

Steps required:

1.) Get desired install path - don't accept path with spaces
2.) Install files
3.) Set path and other environment variables using InnoSetup scripting / built in registry functions
4.) Run relocation.pl.bat
5.) Add menu and desktop icons for Padre
6.) Use InnoSetup built-in function for notifying system that environment changed.

If you tell me where I can download a 'pre-release' of a Padre-on-Strawberry' zip, I'll prepare and test the InnoSetup script which you can then take forward.

IMHO - You really don't want to be writing Windows installation stuff if you can grab something 'off the shelf" to do it for you.

The direct answer to your question is that to notify the system that environment has changed you would need to wrap the API call

SendMessageTimeout(HWND_BROADCAST, WM_SETTINGCHANGE, 0,
                       (LPARAM)"Environment",
                       SMTO_NORMAL, 5000, &dwRetVal);


in Win32::API. It works OK, (I've done this in the past though can't track any code down at present).

I'm not sure if there is a single Perl module that wraps this somewhere.

Regards

Mark


Regards

Mark





On 27/05/2011 16:02, Gabor Szabo wrote:

In the Strawberry package I used to build the Padre-on-Strawberry
package there are two scripts:
relocation.pl.bat   and update_env.pl.bat

After unzipping the package and placing it in a convenient place the user needs
to run these two scripts in order to fix the hard-coded PATH-es in
some perl files and
to change the PATH environment variable of Windows.

This does not take effect immediately and the user either needs to reboot or -
open the window where you can set the environment variables and press OK.
This latter is a bit cumbersome. Is there a way to tell window to do
that without
use interaction? Is there a perl module that can do that?

I am also adding a new script to the package - now I call it setup_padre.pl.bat
which calls padre to add an icon on the desktop of the user.

I guess if the above manual intervention could be eliminated then I
could create
a single .bat that would call the above 3 and setup everything for the user.

Any ideas?

BTW I'd be happy if any of you how understands Windows could take a
look at those scripts.
The first two are only in the distribution. The last one is here:
http://svn.perlide.org/padre/trunk/tools/setup_padre.pl.bat


regards
    Gabor

Reply via email to