Page 1 of 3

Portable Version?

PostPosted: Thu Jul 09, 2009 2:08 pm
by Simeon
Hi All

I heard about this piece of software over at the PortableApps.com forums and I am now trying to make a portable version. A part of the PortableApps.com format (used by all Apps there) is that the application's data is separated from the application files. So I have this one question:

Is there a command line switch or something I can use to redirect GoldenDict to the data folder on the usb drive?

I think its hardcoded to use /username/Application Data/GoldenDict which in my case isnt very usefull.

Any hints are greatly appreciated!

Simeon

Re: Portable Version?

PostPosted: Thu Jul 09, 2009 7:40 pm
by ikm
Just change this in the source code to whatever you want and recompile - I see no problem here.

Re: Portable Version?

PostPosted: Wed Jan 13, 2010 5:44 am
by shula
Just change this in the source code to whatever you want and recompile - I see no problem here.



actually it is a problem, of maintenance.

When GoldenDict will be upgraded / changed, it will require a recompilation of the patched application.

It will be much more versatile for all users to have a command line switch, or other settings, to indicate where the dicts are indexed. However, Since i'm not a C++ programmer, I wouldn't know how.

Re: Portable Version?

PostPosted: Thu Apr 15, 2010 2:45 pm
by Alec
I would also like to ask for a portable version, with an editable text file to specify that the GoldenDict/index folder should be on the memory stick or wherever.

I use GoldenDict on four computers. It runs from my USB stick, but has to create a new /index folder on each computer.

I love this program and use it very often. I think it would be very useful to the students at my university, but they have to use different computers every day, so the only sensible option is to give each student his or her own copy of GoldenDict on a memory stick.

Actually, if the location of the index folder and other system files were specified in an editable text file, there would be no need for a separate portable version; that file could contain the default location, and users who wanted to make it portable could simply edit that file.

Why not just put the index folder (and the config, history and pid files) in a sub-folder of wherever the EXE file lives?

the path in source code is not enough !

PostPosted: Tue May 04, 2010 11:16 am
by shula
I just tried to changed the path in source code, i recompiled, but it's not enough:

after recompiling and testing, i've closed GD,
i copied all my %userprofile%\app data\GoldenDict\*.* into the new path
but GD is re-indexing the dictionaries on EVERY NEW LOCATION.

after short investigation, there are 2 or 3 places where the data dir is defined (x2, for win and linux...)

here's what i've tried (in config.cc):
Code: Select all
  QDir getHomeDir()
  {
    QDir result;
    char const * pathInHome;
    QByteArray pEnv = qgetenv("GOLDENDICT");

    if(pEnv=="portable") {
        result = QDir::currentPath();
        pathInHome = "data";
    }
    else {
   ...


so why the dictionaries are re-read every time i move the program folder?

Re: Portable Version?

PostPosted: Tue May 04, 2010 11:54 am
by ikm
Since their ids are derived from their full paths.

Re: Portable Version?

PostPosted: Fri May 28, 2010 9:11 am
by Alec
In a normal day's work, I use at least three PCs in different locations, and sometimes more. My colleagues and students have similar patterns of work. It's just the nature of my work (and hobbies!) that I can't keep all the relevant files and programs in a single fixed location, so I work mainly from memory sticks. I would very much like a truly portable version of GD.

However, since that isn't available, I've been trying to persuade GD at least to make a single index on the stick, and not clutter up the various hard disks with multiple copies of the same information (over 200 MB -- I use a lot of dictionaries), which need to be rescanned and updated every time I make a change, which is quite frequently.

(Students, of course, do not have Administrator rights to our general-access computers, so cannot use GD at all, unless we install it separately on all 2000+ machines, which isn't going to happen.)

I have had *partial* success with persuading GD to create its index in a different location, but only partial. In Windows Vista, GD usually creates its index in C:\Users\{myusername}\AppData\Roaming\GoldenDict . I used Symlink Creator to create a symbolic folder link called "index" in that location, and refer to where I'd prefer to keep the index, which is on the same USB stick that contains GD's home folder and my dictionaries. That worked: GD obediently created the index on the stick, and didn't clutter up the hard disk. However, I have been unable to persuade my XP and Windows 7 PCs to do the same trick; the "index" symlink simply doesn't appear, despite dialogue boxes reporting that it has been successfully created. If anyone knows how to do that, I would be very grateful for advice.

However, I'm not sure that even achieving that would make GD portable: would the index created by one PC be unrecognized by another? If so, I'd be no further forward.

Of course, I would be even more grateful for a portable version of GD, which would make all this hacking unnecessary, and would instantly make GD available to thousands of grateful students.

Alec.

Re: Portable Version?

PostPosted: Fri May 28, 2010 5:02 pm
by ikm
Ok, I gave up and implemented portable mode. It's in Git now. To activate portable mode, simply create a directory named "portable" in the program's directory. I have to admit I really like how it feels in that mode -- no dependencies, no nothing. So enjoy :)

p.s. I've asked someone to build the latest version in that Russian topic with Git builds, hopefully it would be available soon.

Re: Portable Version?

PostPosted: Sat May 29, 2010 8:24 am
by Gloggy
ikm wrote:Ok, I gave up and implemented portable mode. It's in Git now.

This is simply AWESOME!!! Thanks, Konstantin. This is one of the major features for me, now that I could prepare portable versions of GoldenDict and supply my parents and friends with one simple package where everything is pre-configured on a flash drive, no extra work is needed! :)

P.S. Windows build is in the works.

Re: Portable Version?

PostPosted: Sat May 29, 2010 8:51 am
by Gloggy
The latest GoldenDict with portable support is here: viewtopic.php?f=8&t=77&p=3127#p3127

So far, works great! :)