|
From: Christian M. <chr...@ta...> - 2013-01-30 07:25:37
|
Hello Geoff,
I'm very sorry for the delay, I haven't noticed that you haven't received
any reply.
It's actually a very good idea to make it possible to specify a location
for the wrapper executable file.
So I have already added a variable to the script for this task which will
be part of the next release.
The basic implementation is similar, but since it will be available to all
users, I had to add some more checks, to handle special characters, spaces
in the path. Furthermore I introduced a new variable "_WRAPPER_DIR" which
contains the path, since I think "_WRAPPER_BASE" should only contain the
base name of the application.
So this is the implementation, if you have any suggestions, please let me
know:
rem The base name for the Wrapper binary.
set _WRAPPER_BASE=wrapper
rem The directory where the Wrapper binary (.exe) file is located, this can
be
rem either a absolute or relative path. If the path contains any special
characters,
rem please make sure to quote the variable.
set _WRAPPER_DIR=..\bin\
...{...}...
:nt
rem Find the application home.
rem if no path path specified do the default action
IF not DEFINED _WRAPPER_DIR goto no_default
set _WRAPPER_DIR_SPACED="%_WRAPPER_DIR:"=%"
if not "%_WRAPPER_DIR:~-2,1%" == "\" set
_WRAPPER_DIR_SPACED="%_WRAPPER_DIR_SPACED:"=%\"
rem check if absolute path
if "%_WRAPPER_DIR_SPACED:~2,1%" == ":" goto absolute_path
if "%_WRAPPER_DIR_SPACED:~1,1%" == "\" goto absolute_path
rem everythig else means relative path
set _REALPATH="%~dp0%_WRAPPER_DIR_SPACED:"=%"
goto pathfound
:no_default
rem Use a relative path to the wrapper %~dp0 is location of current script
under NT
set _REALPATH="%~dp0"
goto pathfound
:absolute_path
rem Use an absolute path to the wrapper
set _REALPATH="%_WRAPPER_DIR_SPACED:"=%"
:pathfound
........
Best Regards,
Christian
On Wed, Jan 23, 2013 at 12:20 AM, <geo...@rb...> wrote:
> Hi Christian,
>
> Thanks for the response.
>
> >In the windows batch The batch file and the wrapper.exe file have to be in
> >the same directory, so are you referring that you want to keep the batch
> >files and the wrapper.exe files in different locations?
>
> Exactly, we typically have many 10s of Windows services running each with
> its own conf files and batch files.
>
> But we don't want to have to copy the wrapper.exe 10s of times.
>
> It may be worth noting that we generate the 100s of conf files and batch
> files for the 100s of services we run
> on Windows, Solaris & Linux automatically from templates as part of our
> build process.
>
> >If so, with the current batch files, I think you have to change the area
> below the "do not modify" section :)
>
> Indeed and we can see how to do this in the same way as your example.
>
> But we'd rather not do this as TanukiSoft may also change the section
> below the "do not modify"
> section for later versions of the wrapper then we run into versioning
> issues.
>
> It would be nice if the Windows batch file could work like the Unix batch
> file and check to see if the
> wrapper location was relative and absolute & select the wrapper from that.
>
> Something like this (change the REMs at the start to select various
> absolute and relative wrapper paths):
>
>
> rem The base name for the Wrapper binary.
> set
> _WRAPPER_BASE=c:\services\local1\ln\services\thirdparty\tanukisoft\wrapper
> rem set
> _WRAPPER_BASE=\\ln12345\c$\services\local1\ln\services\thirdparty\tanukisoft\wrapper
> rem set _WRAPPER_BASE=..\..\..\..\..\thirdparty\tanukisoft\wrapper
> rem set _WRAPPER_BASE=wrapper
>
> rem if absolute path to wrapper used then use that
> if "%_WRAPPER_BASE:~1,1%" == ":" goto absolute_path
> if "%_WRAPPER_BASE:~0,2%" == "\\" goto absolute_path
> rem Use a relative path to the wrapper %~dp0 is location of current script
> under NT
> set _REALPATH=%~dp0
> goto pathfound
> :absolute_path
> rem Use an absolute path to the wrapper
> set _REALPATH=
>
> :pathfound
> set _WRAPPER_L_EXE=%_REALPATH%%_WRAPPER_BASE%-windows-x86-32.exe
> echo %_WRAPPER_L_EXE%
>
>
>
>
> ***********************************************************************************
> The Royal Bank of Scotland plc. Registered in Scotland No 90312.
> Registered Office: 36 St Andrew Square, Edinburgh EH2 2YB.
> Authorised and regulated by the Financial Services Authority. The
> Royal Bank of Scotland N.V. is authorised and regulated by the
> De Nederlandsche Bank and has its seat at Amsterdam, the
> Netherlands, and is registered in the Commercial Register under
> number 33002587. Registered Office: Gustav Mahlerlaan 350,
> Amsterdam, The Netherlands. The Royal Bank of Scotland N.V. and
> The Royal Bank of Scotland plc are authorised to act as agent for each
> other in certain jurisdictions.
>
> This e-mail message is confidential and for use by the addressee only.
> If the message is received by anyone other than the addressee, please
> return the message to the sender by replying to it and then delete the
> message from your computer. Internet e-mails are not necessarily
> secure. The Royal Bank of Scotland plc and The Royal Bank of Scotland
> N.V. including its affiliates ("RBS group") does not accept responsibility
> for changes made to this message after it was sent. For the protection
> of RBS group and its clients and customers, and in compliance with
> regulatory requirements, the contents of both incoming and outgoing
> e-mail communications, which could include proprietary information and
> Non-Public Personal Information, may be read by authorised persons
> within RBS group other than the intended recipient(s).
>
> Whilst all reasonable care has been taken to avoid the transmission of
> viruses, it is the responsibility of the recipient to ensure that the
> onward
> transmission, opening or use of this message and any attachments will
> not adversely affect its systems or data. No responsibility is accepted
> by the RBS group in this regard and the recipient should carry out such
> virus and other checks as it considers appropriate.
>
> Visit our website at www.rbs.com
>
>
> ***********************************************************************************
>
>
>
> ------------------------------------------------------------------------------
> Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
> MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
> with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
> MVPs and experts. ON SALE this month only -- learn more at:
> http://p.sf.net/sfu/learnnow-d2d
> _______________________________________________
> Wrapper-user mailing list
> Wra...@li...
> https://lists.sourceforge.net/lists/listinfo/wrapper-user
>
|