Page 1 of 1

Thumb drive installation and perl add-on

PostPosted: 20. November 2007 20:29
by JoeSmith
Okay, I've been fiddling with this for some time, including doing forum searches, both here and other sites.

I am looking to do a thumb drive install of xampp and the full perl add-on.

From my reading of the the install instructions for XAMMP I understand that I do not use the xampp_setup.bat file for a USB drive installation. However when I update my working XAMPP install (the apache 2.2.4 version) with the full perl add-on my status page reports perl as deactivated. Everything else reports as running fine. I can resolve the perl issue by running the xampp_setup.bat file, which defeats the purpose of the thumb drive installation.

I'm certain the problem lies with my understanding of paths and configuration files, which is limited to say the least. Can someone point me to a tutorial regarding portable web servers that would help a neophyte?

Thanks.

PostPosted: 20. November 2007 20:43
by userdude
.bat files are simply text files for running executable commands (think like a plaintext executable), so you can right-click on the .bat and open it in notepad and see what exactly the .bat is doing during installation.

The problem you will run into will be getting the path for a device that inherently will never *know* what it's path is (since it is completely arbitrary).

You could actually run the xampp application using a .bat file, that will run it in such as way as to give you relative paths. Or, you could have it write the current path to a config file and store it on the usb drive on every startup.

You might do web searches on autorun.inf and batch files to see what can be done. I've gotten Firefox to work on USB drives using .inf, and I think that .bat should probably help.

PostPosted: 20. November 2007 21:29
by JoeSmith
userdude wrote:...
The problem you will run into will be getting the path for a device that inherently will never *know* what it's path is (since it is completely arbitrary).

...


Yes, that is the rub, lol. And the xampp_setup.bat file seems to resolve the perl issue by hardwiring the full, non-relative, path into every script using a shebang line.

I will examine some other .bat files, and do some research on autorun.inf.

Thanks for your response.

PostPosted: 20. November 2007 22:03
by Izzy
There is a previous post USB Tips and Tricks (xampp using relative path) that contains a hack that will do this job for you provided by patrick_yi_82 who had trouble with absolute paths on a portable device (I located this using keyword usb in a forum search):
http://community.apachefriends.org/f/viewtopi ... 4289#84289

Extracted from this post:
http://community.apachefriends.org/f/viewtopic.php?t=27332

EDIT
Fixed the link.
/EDIT


===========================================
1. The new DeskTopXampp Launch Control for XAMPP / XAMPPlite
Posted by Ridgewood available from Ridgewood'sDTX web site

2. Build Rich AJAX Applications - Faster
TIBCO General Interface Pro Edition but FREE and Open Source
Fully working with NO donations required to get a user/password
===========================================

PostPosted: 20. November 2007 22:03
by userdude
Are you running xampp_start.exe to get it going once the drive is ready? From what I understand, if you run xampp_start.exe *through* an .inf file (say, start.inf), that then sets the absolute path to the current drive path. I'm sure that there's something off about that description, but that is what worked for me...

I don't know anything about Perl, though, so other than installing and then replacing all the shebangs with relative paths or creating a program to recursively replace them on startup, I don't know what to tell you!

Can you post the xampp_setup.bat code? Mine has a different name (setup_xampp.bat) and has this inside:

Code: Select all
@ECHO OFF

if "%1" == "sfx" (
    cd xampp
)
if exist php\php.exe GOTO Normal
if not exist php\php.exe GOTO Abort

:Abort
echo Sorry ... cannot find php cli!
echo Must abort these process!
pause
GOTO END

:Normal
set PHP_BIN=php\php.exe
set CONFIG_PHP=install\install.php
%PHP_BIN% -n -d output_buffering=0 %CONFIG_PHP%
GOTO END

:END
pause

PostPosted: 20. November 2007 22:06
by userdude
/fixed

PostPosted: 20. November 2007 22:39
by JoeSmith
Thanks guys,

In my search I did find some information on AMPStart as a launcher, with it's own .ini file. I'm going to fiddle with that next.

And Izzy, I used every search except USB I guess, thanks for the link.

Userdude, we are talking about the same file, I deleted everything last night in order to start fresh and was posting from memory. At my age not such a good idea anymore. I've only been using the control panel to start the services. But I will look at the .bat files and try setting up a .inf if I am not happy with AMPStart. Important for me to be able to hand the stick off to anybody and have it run.

Tonight I will start with fresh clean installs of everything on my USB drive and get back to you folks with my results. Ah Thanksgiving, with the long weekend, :)

I'm starting to do some website development, mostly this is for testing and learning. I'll need to carry the results to different folks, and having everything on the thumb drive set up and working means I could even send someone else the thumb and they could play with the test site. I'll never be a full-fledged website developer, but I want to know enough to ask the right questions of someone else, as well as handle simple updates, changes, and the like on my own.

Thanks.

PostPosted: 20. November 2007 23:12
by userdude
I thought this was good for explaining autorun:

http://dailycupoftech.com/usb-drive-autoruninf-tweaking/