You are here

No profile after starting TBP with FreePops

5 posts / 0 new
Last post
BungieCord
Offline
Last seen: 5 years 7 months ago
Joined: 2009-03-12 16:11
No profile after starting TBP with FreePops

I've just updated the TBP on my thumb drive to v2.0.0.19 and my Portable Apps Platform to v1.5. While I was at it, I decided I'd make some improvements to the way my portable apps are set up. But it isn't working as I'd intended and I can't figure out why.

Because I manage several webmail-only E-mail accounts with T-Bird, I wrote a batch file that starts FreePops before invoking the PAP. But it always seemed crude that FreePops was launched along with PAP regardless of whether I intended also to use TBP, so I decided to massage things a bit and try to start FreePops only when TBP was launched from the PAP menu.

I copied the ThunderbirdPortable.ini file to the PortableApps\ThunderbirdPortable directory (alongside the ThunderbirdPortable.exe file) and edited the line "ThunderbirdExecutable=" so it would run a batch file of my making rather than starting the TBP executable. Then I wrote a batch file in the PortableApps\ThunderbirdPortable\App\Thunderbird directory that starts FreePops, pauses a few seconds (to let FreePops load fully and avoid a localhost communication error message), then starts thunderbird.exe. Lastly, I copied my profile files from T-Bird on my desktop PC to the TBP profile on my thumb drive.

Here comes the problem. If I start TBP from the PAP menu, it launches FreePops, pauses, then starts TBP, just as advertised. But TBP always starts the "new installation setup" as if it can't locate or read from my profile. If I change the extension on the modified ThunderbirdPortable.ini file so it isn't recognized and restart TBP, it does read from my profile and all my mail and account settings are present.

The wildcard obviously is the configuration contained in the .ini file so I edited the "ProfileDirectory=" line. The default configuration didn't work so I changed it to "..\..\Data\profile", which is the relative path from thunderbird.exe (as per the instructions from the readme.txt file). But no change. TBP still thinks it is a fresh install and no profile settings are present. In fact, I tried adding "..\..\" to each line in the .ini file looking for data\* in the default configuration. No change.

Yeah, I could go back to the original setup, as inelegant as it is, but that would be wimping out on a challenge. Plus, if I manage to make it work the way I want, I might learn something.

So what have I overlooked? How do I include the extra step of starting FreePops when I start TBP from the PAP menu but also enable it to find my profile files?

John T. Haller
John T. Haller's picture
Offline
Last seen: 4 hours 9 min ago
AdminDeveloperModeratorTranslator
Joined: 2005-11-28 22:21
Webmail Extension

A far easier solution would be to use the webmail extension as that would then be a part of Thunderbird itself.

You can't put a batch file in the ThunderbirdPortable.ini. The launcher puts a command line option in that it passes to thunderbird.exe directly that tells it where the profile is. This path changes depending on drive letter. With your batch file in the way, you're basically running Thunderbird directly... so it's using the local APPDATA profile or trying to create one.

Sometimes, the impossible can become possible, if you're awesome!

BungieCord
Offline
Last seen: 5 years 7 months ago
Joined: 2009-03-12 16:11
John, I'm afraid the webmail

John, I'm afraid the webmail extensions solution wouldn't work for me because my webmail accounts are from obscure domains that aren't currently supported, nor are they likely to be in the near future.

But you did give me a clue that allowed me to fix my problem. I started examining the environmental parameters being passed to my batch file, then editing the .ini accordingly. Editing the AdditionalParameters line wasn't having any affect so I tried editing the batch file directly. It was passing "-profile" as %1 so I just added "-profile ..\..\Data\profile" (the relative path to my "profile" directory) to the end of the line in my batch file that was starting thunderbird.exe and, Bada-Bing, it worked.

Thanks for the help!

EDIT:
To recap, I eliminated any potential drive letter problems by including the following line in the batch file that starts PAP, before it invokes PAP:

---------------------------------------------
For /F "Tokens=*" %%D In ('CD') Do Set CD=%%D
---------------------------------------------

Now the absolute system path to the thumb drive's root directory is "%CD%" -- regardless of the drive letter the OS chooses to assign -- and this parameter is passed to all child processes.

I also created a local \Temp directory on the thumb drive, which reduces the potential for leaving personal data on a public PC. Including the following three lines in the same batch file (and before starting PAP) causes it to empty the existing %CD%Temp directory, then designate %CD%Temp as the shell's Temp directory:

---------------------------------------------
DEL /f /s /q %CD%Temp\*.*

SET TEMP=%CD%Temp

SET TMP=%CD%Temp
---------------------------------------------

I copied ThunderbirdPortable.ini to the %CD%PortableApps\ThunderbirdPortable directory. Then I edited it, changing the second line as follows:

---------------------------------------------
ThunderbirdExecutable=Start_T-Bird.cmd
---------------------------------------------

I created the batch file "Start_T-Bird.cmd" in the directory
%CD%PortableApps\ThunderbirdPortable\App\Thunderbird (copy below). So this is the contents of the batch file designated in the ThunderbirdPortable.ini:

---------------------------------------------
@ECHO off

START /B /D%CD%FreePops freepopsd.exe

PING -w 1000 -n 5 1.1.1.1 >NUL

CD App\thunderbird

START /B /D. thunderbird.exe -profile ..\..\Data\profile

EXIT
---------------------------------------------

The breakthrough was adding that " -profile ..\..\Data\profile" option to the thunderbird.exe command. It now works perfectly. When I start TBP from PAP, it starts FreePops first, waits a few seconds, then starts TBP. And TBP now recognizes and loads my profile.

OliverK
OliverK's picture
Offline
Last seen: 3 years 5 months ago
Developer
Joined: 2007-03-27 15:21
Modify your appinfo.ini to

Modify your appinfo.ini to start the bat file, then invoke ThunderBirdPortable.exe with the BAT file. Very clean.

Too many lonely hearts in the real world
Too many bridges you can burn
Too many tables you can't turn
Don't wanna live my life in the real world

BungieCord
Offline
Last seen: 5 years 7 months ago
Joined: 2009-03-12 16:11
I'd have saved myself a lof of brainercize ...

...if I'd have RTFM first, huh?

Thanks, OliverK! I'm sure at some future juncture I once again will be overcome with the urge to do something needlessly complex and that tip doubtless will save me a lot of grief.

Log in or register to post comments