install_services.bat
Posted by: gamecp (74.102.52.---)
Date: February 26, 2011 08:13AM

Hello Everyone

I have used this wampserver program for some time now - what's always puzzled me is the lack of an install batch file - you can uninstall with a batch, why not install?

This makes your wamp install more portable - or like me - allows you to offer it easier to other people.


This has tested to work very well.

c:\wamp\install_services.bat

@ECHO off
.\bin\apache\apache2.2.17\bin\httpd.exe -k install -n wampapache
NET START wampapache
.\bin\mysql\mysql5.5.8\bin\mysqld.exe --install-manual wampmysqld
NET START wampmysqld
cmd /c start wampmanager.exe
cd scripts
.\bin\php\php5.3.5\php-win.exe -c onlineOffline.php
.\bin\php\php5.3.5\php-win.exe -c refresh.php


I urge the wampserver admins to add this - it would be a very useful tool to many.

-- William (GameCP CEO)
-- [GameCP.com]



Edited 2 time(s). Last edit at 02/26/2011 08:14AM by gamecp.

Options: ReplyQuote
Re: install_services.bat
Posted by: stevenmartin99 (---.251.255.14.threembb.ie)
Date: February 26, 2011 12:30PM

Your file is useless in the sense that u can install Many versions of php mysql and apache.

That's why they are on the menu (uninstall and install)

U can uninstall a service with just the service name. But u need the path to the exe to install it

That's why it's not there.

Steven Martin
stevenmartin99@gmail.com
stevenmartin99@hotmail.com
PampServer.com - [pampserver.com]



Edited 1 time(s). Last edit at 02/26/2011 08:01PM by stevenmartin99.

Options: ReplyQuote
Re: install_services.bat
Posted by: gamecp (74.102.52.---)
Date: February 26, 2011 04:35PM

Your comment is useless.



Edited 3 time(s). Last edit at 02/26/2011 05:19PM by gamecp.

Options: ReplyQuote
Re: install_services.bat
Posted by: stevenmartin99 (---.b-ras1.srl.dublin.eircom.net)
Date: February 26, 2011 07:57PM

what? my comment is correct. this code you wrote is of no use to anyone if they are using other versions..

because you hardcoded version numbers in. make a bat file that open the wampmanager.conf file
and reads out the version numbers and then it will be a great tool.


i didnt mean it to sound bad.. but i just gave you the reason why there is no install services bat file.

Steven Martin
stevenmartin99@gmail.com
stevenmartin99@hotmail.com
PampServer.com - [pampserver.com]

Options: ReplyQuote
Re: install_services.bat
Posted by: gamecp (74.102.52.---)
Date: February 26, 2011 11:16PM

You should say its of no use to you - you cant speak for everyone Steven. Clearly this is of major use to me - and my clients - as it makes it easy to pre-package a program with wamp - and distribute it to the world.

The batch I made works exactly as the uninstall batch - both are hard coded - the fact that php and apache versions may change does not matter to my script - you install it once - the versions are hard coded to be 100% exactly as wampserver ships.

Options: ReplyQuote
Re: install_services.bat
Posted by: stevenmartin99 (---.b-ras1.srl.dublin.eircom.net)
Date: February 26, 2011 11:34PM

whats wrong with the menu?????????????????

left click wamp>apahce>service>remove
left click wamp>apache>service>install

left click wamp>mysql>service>remove
left click wamp>mysql>service>install

im not trying to fight with you - but you dont know what your talking about. the uninstall script wasnt designed to be used by the user. Its used by the uninstaller script.

and wampserver actually comes with a service install script that WampServer uses on install ( which installs the service "correctly" into the current control set.)

.\bin\apache\apacheWAMPAPACHEVERSION\bin\httpd.exe -k install -n wampapache
reg add HKLM\SYSTEM\CurrentControlSet\Services\wampapache /V Start /t REG_DWORD /d 3 /f
.\bin\mysql\mysqlWAMPMYSQLVERSION\bin\mysqld.exe --install-manual wampmysqld


but like i said this is not suitable to use once the user installs other versions of mysql and apache. as a hardcoded version numbers will install the wrong services.(causing registry issues)

WampServer deletes the install service script after the install because it will be of no use to alot of people as
the main reason people choose wampserver over other WAMPS is the very ability to change versions of components for TESTING..

Compressed bat files in exe's are a major known source of false alarms from Antivirus Software scans and legitimate software being marked as trojans.( which is why wamp creates them during the install)

If you redistrubuting wampserver with your own files you should spend the time to recompile it with your files included instead of having clients messing around with bat files.. ( or they can use the wamp menu which has the service install/uninstall options which are dynamically generated based on the current verions used.

PS - If a client has WampServer installed and installs your program on top , your bat file will just cause more trouble and errors from them , as wampserver uses a "onlyifdoesnotexist" install parameter which means if they have other versions installed of the components they will stay active and your hard coded values will just throw a bunch of silly errors to the user. - you should really recompile changing the service names and the astean tray menu id ={wampserver} which is what makes the uninstall service script included different to your code above

Steven Martin
stevenmartin99@gmail.com
stevenmartin99@hotmail.com
PampServer.com - [pampserver.com]



Edited 3 time(s). Last edit at 02/26/2011 11:41PM by stevenmartin99.

Options: ReplyQuote
Re: install_services.bat
Posted by: gamecp (74.102.52.---)
Date: February 27, 2011 01:22AM

Thank you - that is a much more useful reply.


I am not aware of all the scripting options for wampserver - I simply looked at the uninstall script and reversed it, it does the trick - tho I do like the idea if getting to to detect versions and work better. I will see how to implement that better with your tips.

The idea I was aiming for was to create an msi auto-installer on my own that uses the core versions from 'e' release that can then exec that script - users can then change wamp from the sys icon.

I've done this easily - before wampserver was around - just thought itd be nice to use wampserver these days as the sys icon is user friendly.

Options: ReplyQuote
Re: install_services.bat
Posted by: stevenmartin99 (---.b-ras1.srl.dublin.eircom.net)
Date: February 27, 2011 08:05AM

If you wanna recompile and build it as a installer for your program, start with these 10 steps..

1. download the wamp compiling script for wamp2.1e iss script >> [sourceforge.net]

2. Get a copy of Innosetup to recompile WampServer. >> [www.jrsoftware.org]
3. Get a copy of WampServer2.1e exe
4. Get a copy of InnoUnp >> [sourceforge.net]
5. Extract the Unpacker and put the innounp.exe into a folder along with the WampServer2.1e.exe
6. Open CMD( Start->Run->cmd) and navigate to the folder containing the exe ( if your using Vista or 7 - in the folder with the two exe's just hold down shift and right click the background of the folder, and press Open Command Line Here)
7. Use the following command to extract the files for WampServer in cmd -

innounp -x -m -a wampserver2.0i.exe

8.This will leave you with the files and folders need to recompile WampServer.
9.Set up the environment as it was set up if possible . ( put those files into a folder called C:\Dev\Projets\WampServer2.1e-32bso you dont need to change paths in the iss script)
10. Try compiling Wamp in Innosetup, Once it compiles correctly you can start modifying it to include your files and databases.

need help? email below

Steven Martin
stevenmartin99@gmail.com
stevenmartin99@hotmail.com
PampServer.com - [pampserver.com]

Options: ReplyQuote
Re: install_services.bat
Posted by: gamecp (74.102.52.---)
Date: March 01, 2011 08:41PM

Hi

This is a great writeup.

I had only minor issues with building the .iss

install_files_wampserver2 folder is not included so anything referring to that is busted

[Files]
;Source: C:\Dev\Projets\WampServer2.1e-32b\close\*.*; DestDir: {app}\; Flags: ignoreversion recursesubdirs deleteafterinstall; AfterInstall: close()
;Source: install_files_wampserver2\*.*; DestDir: {app}; Flags: ignoreversion recursesubdirs
;Source: C:\Dev\Projets\WampServer2.1e-32b\install_files_wampserver2\license.txt; DestDir: {app}; AfterInstall: install()

I can imagine that might be some important stuff - it does compile with the bad stuff commented out (Yet to test) but just thought ID ask, where do I get that folder? And the 'close' folder.


Thanks - this is super useful.

** I take it the files go in 'install_files_wampserver2' but still missing close and the icons, that I think may be less of a deal - tho close seems important



Edited 1 time(s). Last edit at 03/01/2011 08:51PM by gamecp.

Options: ReplyQuote
Re: install_services.bat
Posted by: gamecp (74.102.52.---)
Date: March 01, 2011 10:14PM

innounp -x -m -a WampServer2.1e-x32.exe


makes embedded folder, app folder and install_script.iss, nothing else.

{app} folder has all the files. i tried to compile it and it worked but failed to run any of the install scripts, everything was left named as .install

Options: ReplyQuote
Re: install_services.bat
Posted by: stevenmartin99 (---.b-ras1.srl.dublin.eircom.net)
Date: March 01, 2011 10:18PM

Do NOT use the iss script that gets made..... use the one downloaded from SF.


i forgot this bit about the app folder...

---------------------------------------------------

yes all the files are in the {app} folder...


rename this folder to install_files_wampserver2

inside that folder there is a file called closewamp.bat

take it from there and put it in a folder called close in C:\Dev\Projets\WampServer2.1e-32b\


also take the l wampserver2.bmp and the wampserver.ico file and place them into

C:\Dev\Projets\WampServer2.1e-32b\ directly

so you should have

C:\Dev\Projets\WampServer2.1e-32b\wampserver.ico
C:\Dev\Projets\WampServer2.1e-32b\wampserver2.bmp
C:\Dev\Projets\WampServer2.1e-32b\close\       (with closewamp.bat  inside)
C:\Dev\Projets\WampServer2.1e-32b\install_files_wampserver2\ (this should be all the remaining files)

PS you may not get the ico file.. i can send it to you , or you can make your own.

Steven Martin
stevenmartin99@gmail.com
stevenmartin99@hotmail.com
PampServer.com - [pampserver.com]



Edited 3 time(s). Last edit at 03/19/2011 10:50AM by stevenmartin99.

Options: ReplyQuote
Re: install_services.bat
Posted by: gamecp (74.102.52.---)
Date: March 01, 2011 10:46PM

Great! Got it to work

Key was in the close folder and making install_files_wampserver2 totally, works great.

This is totally better then the bat idea, thanks for the time.

Seems nice to be able to customize, package and deploy a specialized wamp install, im thinking of adding icon features and everything as its pretty easy!

Thank you again.

Options: ReplyQuote
Re: install_services.bat
Posted by: stevenmartin99 (---.b-ras1.srl.dublin.eircom.net)
Date: March 01, 2011 10:49PM

just a note.. if your adding a db... make sure its in MYISSAM format

Steven Martin
stevenmartin99@gmail.com
stevenmartin99@hotmail.com
PampServer.com - [pampserver.com]

Options: ReplyQuote


Sorry, only registered users may post in this forum.