How does Picasa Starter do its thing, exactly? (junction/mklink?)

125 views
Skip to first unread message

Jason Buechler

unread,
Apr 15, 2011, 11:57:22 AM4/15/11
to Picasa starter
Picasa Starter seems to have almost magically taken care of all the
technical underpinnings that I would have muscled myself, with some
amount of consternation. I've got to know exactly how you do it,
because if there's a smarter way, I'd love to have that knowledge
"just in case"!

So my question: is Picasa Starter dynamically creating (and removing)
junction/mklink links on demand, for the Picasa directories buried in
%APPDATA%? If so, you should post that information so geeks like me
can revel in it :) If not -- how the hell are you doing it??! :-D

the_roggy

unread,
Apr 15, 2011, 1:15:20 PM4/15/11
to Picasa starter
Hello,

PicasaStarter works differently depending on the windows version you
use:
- Windows XP: PicasaStarter overwrites the %userprofile% environment
variable withe the "BaseDir" choosen in PicasaStarter before starting
Picasa so when Picasa thinks it is writing to your user profile
directories, it actually is writing to the directories you chose in
PicasaStarter...
- Windows Vista and Windows 7: since the directory structures used in
the user profile in these versions of Windows are different than in XP
(XP=Local settings\..., Vista is ...\appdata\Local\... or something
like that), the trick above isn't sufficient to be able to combine XP
PC's and Vista PC's to use the same Picasa Database in a network par
example. Because symbolic links were introduced in Vista, a symbolic
links is placed somewhere in your user profile for every Picasa
database you create in picasastarter pointing to the "BaseDir" you
defined + the path needed for a windows XP PC... Because creating
symbolic links requires admin privileges, PicasaStarter creates them
only once, and it lets you choose between the different ones by using
the same trick as in XP: it sets the %userprofile% to the right place
to the symbolic link is actually used, and this points to the right
spot... this way it is not needed to ask for admin priviledges every
time you run PicasaStarter...

I hope it is possible to follow somewhat, I admit it is a kind of
difficult explanation...

The source code is available here, maybe this could clear things up
(or make more confusion :-)?):
http://code.google.com/p/picasastarter/

Further questions

Regards,
The_roggy...

Jason Buechler

unread,
Apr 15, 2011, 7:31:30 PM4/15/11
to Picasa starter
Actually that made perfect sense, thank you!

Playing with the program a little bit, and looking at the FAQ, I have
a followup question:
When using an external USB drive and Picasa Starter to make a
"portable" solution, one would have to ensure that the external drive
mounted *using the same drive letter* on each computer with which you
wanted to access your database, correct? In other words, if I
initially set up Picasa Starter on ComputerA, using base directory "F:
\PicasaDB\" ... then I'd better make sure that on ComputerB, my
external drive is the F drive, right? Same with ComputerC and
ComputerD, etc...

I know that point #1 in the FAQ says essentially that, but it might
help to explicitly state it in point #4 for users that aren't very
understanding of what's going on.


Along those lines-- if you are running PicasaStarter.exe (and its
PicasaStarterSettings.xml) from an external USB drive, is it possible
to establish the base directory using a *relative* path (or is this
something you looked into and found technical unfeasible)?? In other
words, instead of specifying "F:\PicasaDB\", would it be possible to
specify ".\PicasaDB" if both PicasaStarter.exe and the base directory
were in the same location?

earlboss

unread,
Apr 16, 2011, 12:55:22 PM4/16/11
to Picasa starter
Hi Jason:
Assuming the pictures are also on the USB drive also, yes the USB
drive must be mounted as the same drive letter.

Picasa Starter tricks Picasa into accessing what it thinks is it's
normal database on another drive. That database is created by Picasa
and it contains references to the full path to the pictures including
drive letter, so picasastarter can be anywhere, and it's database can
be anywhere, but the pictures referred to in the database must be in
the drive and folder they were in when the database was created. As
far as I can tell, and intuitively, Picasa does not use relative
paths. You can of course move the pictures to another drive using
Picasa, but that isn't something you would do in the field.

I have used the Subst command to mount a folder from a USB drive as a
drive letter, and then PicasaStarter seemed to work correctly, but I
didn't test it extensively. I actually used the Vsubst freeware
utility which works on XP and Win7/Vista. I am a little worried about
using it with a portable solution, because it requires you to screw
with the PC you are mounted on, and I don't know if it requires admin
access. The way I did it was I had a folder on the USB drive called
"Picasa P Drive" which contained picasastarter, the Pictures, and the
database. I mounted it as drive P: using vsubst, and then I could run
Picasastarter successfully from P:

Earl

earlboss

unread,
Apr 16, 2011, 2:04:42 PM4/16/11
to Picasa starter
Actually.... subst might not be too bad.

You could make a .bat file on your USB drive that substituted a fixed
drive letter (like P:) with the current drive, then switch to the P:
drive and run PS from there.
The BAT file might look a little like this:
/////////////////
subst P: . (this would set P drive to present path)
P:\ (Log on to P:)
Picasastarter\picasastarter.exe /autorun P_Pictures
////////////////

This would map the usb drive to drive P, change to drive P, and then
autorun Picasastarter from a picasastarter directory. I think this
needs a little work including exception testing and providing for the
possibility that the USB is already the P drive, or that P: is already
present. Maybe also some cleanup afterwards.

I haven't tried this yet, YMMV

Earl
> > were in the same location?- Hide quoted text -
>
> - Show quoted text -

earlboss

unread,
Apr 16, 2011, 3:13:16 PM4/16/11
to Picasa starter
This .BAT file in my USB drive root directory works, at least in Win7
x64. The USB Drive was Drive W: and the DB and Pictures were for L
drive.

IF EXIST L:\nul GOTO end
subst L: .
L:
"L:\picasastarter\PicasaStarter.exe" /autorun "L Database"
subst L: /d
:end

This bat file does this:
- Make sure L: doesn't exist.
- Subst makes an L drive pointing to "." (the present USB directory).
- Change to new L Drive
- Run picasastarter which is in the picasastarter directory.
- Release the L: drive after Picasastarter ends.

A better Bat file would check for the case that the drive was already
the L drive and not do the subst.

Earl
> > - Show quoted text -- Hide quoted text -

Quazeye

unread,
Apr 17, 2011, 10:51:17 AM4/17/11
to picasa...@googlegroups.com
You can use the program USBDLM (USB Drive Letter Manager - google it) it
allows you to auto assign a drive letter to a USB drive using a few
different methods. Very easy to use with good documentation and free.

Q

Pieter Roggemans

unread,
Apr 17, 2011, 11:48:19 AM4/17/11
to picasa...@googlegroups.com
I'm afraid it is not a good idea to let PicasaStarter use relative paths. 

The problem is that the Picasa Database doesn't use relative paths... So If you create albums,... Picasa keeps full path references to the files, so it doesn't help that PicasaStarter would support it... 

The trick earl explained above should work though... it "automizes" the remapping of the mapped drive to the letter you want. The tool 

Quazeye

  mentioned I don't know... but might do the same thing...

Regards.

2011/4/17 Quazeye <qua...@gmail.com>

earlboss

unread,
Apr 17, 2011, 6:37:14 PM4/17/11
to Picasa starter
Ok, here is a more complete version of a Batch file to ensure Picasa
runs from the correct drive letter.

When you insert the USB drive into a PC, the USB drive will be
assigned the next available drive letter, but Picasa Starter will only
run Picasa correctly from its configured drive. When you run
this .bat (Batch) file, the correct drive letter will be asigned to
the drive, and Picasa Starter will be called to run Picasa.

I named the file " RunPicasa.BAT" and it is in the root directory of
the USB drive.
The file must be modified for the proper drive letter, paths and
autorun required for your setup. I used the L: drive in this example:
You could copy & paste the lines below into a new text file with
a .bat extension.
--------------------------------------

REM Check if this is already the correct drive letter
IF EXIST .\picasastarter\nul GOTO WeAreThere
REM Check if drive letter previously assigned
IF EXIST L:\nul GOTO end
subst L: .
L:
:WeAreThere
"L:\picasastarter\PicasaStarter.exe" /autorun "L Database"
REM Delete drive if it was a subst drive
subst L: /d
:end

--------------------------------------------
The directory structure on this drive was:
L:\Picasastarter <- The folder cantaining Picasa Starter & .XML
file
L:\Pictures <- The folder containing all picture folders
L:\L Database <- The folder containing the Picasa database
L:\RunPicasa.BAT <- This Batch file,double click to run.

If you want to use a different drive (for instance P:) you will need
to modify the file accordingly. The only down side to this is that a
command window will be open behind picasa. You could also just
execute the subst command to assign the proper drive letter and then
go to that drive for whatever you want to do.

Note that this will not work for network drives!

Earl


On Apr 17, 8:48 am, Pieter Roggemans <pieter.roggem...@gmail.com>
wrote:
> I'm afraid it is not a good idea to let PicasaStarter use relative paths.
>
> The problem is that the Picasa Database doesn't use relative paths... So If
> you create albums,... Picasa keeps full path references to the files, so it
> doesn't help that PicasaStarter would support it...
>
> The trick earl explained above should work though... it "automizes" the
> remapping of the mapped drive to the letter you want. The tool Quazeye
>  mentioned
> I don't know... but might do the same thing...
>
> Regards.
>
> 2011/4/17 Quazeye <quaz...@gmail.com>
> > > - Show quoted text-- Hide quoted text -

earlboss

unread,
Apr 18, 2011, 12:37:55 AM4/18/11
to Picasa starter
OOPS!
I made a mistake in the batch file above, The second line should be:
IF EXIST L:\picasastarter\nul GOTO WeAreThere
I forgot the drive letter & colon!

Also please notice that the subst command is subst L: .
That is L, followed by colon followed by a space, followed by a dot
(.).
The dot means "the present directory".
> > - Show quoted text -- Hide quoted text -
Reply all
Reply to author
Forward
0 new messages