On Sun, Oct 27, 2013 at 11:08 PM, Michael Petch <[email protected]> wrote:
> On 2013-10-27 14:21, Philippe Michel wrote: > > The portable version would then be started from a short script that > > determines where it is run from, sets the environment variable > > accordingly and launches the real executable with -s > > %GNUBGDATA\preferences or something similar. > > [snip] > > The only way to pass a command line parameter to GNUBG and have it work > with relative paths is to create a batch (.cmd or .bat) file that > launches GNUBG. > > For the MS Windows world, I was toying with a solution a long the lines > of your suggestion since portability seems to be a feature request > there. The idea is to add an option to the installer for those who wish > to create a portable install (Some installers have a similar advanced > portable install feature). This advanced/expert option would be a page > that: > > a) Asks users if they wish to install to a portable device (ie. USB) > b) Ask user for a relative path to install preferences. Default is blank > which would translate to a period (.) directory being passed to GNUBG > which would result in the base preferences directory being that of the > install directory. > c) Installer launches gnubg-cli.exe, issues "save settings" command, > then exits. This creates a new configuration file (gnubgautorc) but with > absolute paths. > d) Once gnubg-cli exits the installer reads the config file and does a > simple text deletion. All the absolute paths (The install directory > base) is simply removed. > d) Create a batch file (.cmd) in the install directory that launches > GNUBG with the required -s parameter. > > Once installed a portable user launches the batch file to start GNUBG. > > This doesn't require changes to GNUBG, but does require the installer to > do text substitution on an initially created gnubgautorc resulting in > making the data path elements relative (sound files, MET file etc). > > [snip] > So one could write a .bat or .cmd batch file doing just that, Once gnubg is installed on the USB-stick (or other rewritable portable device) you could run that batch file and you would have a portable version. If doing it by hand is too tedious, I'm willing to spend some time on that. N. -- “Logic will get you from A to B. Imagination will take you everywhere.” A. Einstein
_______________________________________________ Bug-gnubg mailing list [email protected] https://lists.gnu.org/mailman/listinfo/bug-gnubg
