calibre Portable Launcher Dev Test 1

Application: calibreCategory: OfficeLicense: GNU GPLLanguage: MultilingualDescription: calibre Portable is the popular calibre packaged with a PortableApps.com Launcher as a portable app, so you can take your ebook manager with you. It has all the same great features as calibre including library management, format conversion, syncing to ebook reader devices, fetching news from the web & converting it into ebook form, viewing many different ebook formats, giving you access to your book collection over the internet using just a browser/email client & more.

calibre Portable will remove any files leftover in the root directory of your system drive from a MSVC installation.

0.6.36 Dev Test 1 (2010-01-27):

calibre updated to 0.6.36.

Added check for MSVC SP1, although if neither are found, the original (pre SP1) version will still be installed.

Corrected non-admin error message.

0.6.34 Dev Test 1 (2010-01-16):

calibre updated to 0.6.34.

App directory name has changed. If you're upgrading & use "calibrePortable.ini" to redirect the library, make sure the "calibreDirectory" entry = "App\calibre".

Added Albanian, Basque & Turkish language support.

Trolltech Qt Factory Cache is now 4.6.

0.6.23 Dev Test 1 (2009-11-14):

If you haven't upgraded from calibre Portable 0.6.16 yet, please read the notes for 0.6.21 as they apply to all new releases until further notice.

I have dropped the Data directory restructuring code from the installer. If you're upgrading from 0.6.8 Dev Test 1, a clean install is now required.

The code that creates the settings & library directories has been reworked & both are now configurable on first run.

There is now a 'usertype check' in the launcher. If MSVC is not on the system & you aren't logged in as admin (ie: don't have the rights to install it), calibre Portable will warn you & then quit gracefully.

calibre updated to 0.6.23. No issues.

I wasn't quick enough for 0.6.22!

0.6.21 Dev Test 1 (2009-11-13):

calibre 0.6.21 requires Microsoft Visual C++ 2008. The redist is included in this package (which is *not* an online installer). The launcher will check to see if it's on the local system. If not, you'll be asked to install it &, on exit, it'll be uninstalled. Just follow the prompts. Requires admin rights.

As the MSVC installer creates a mess all of it's own, the launcher cleans up after it.

As a program (MSVC) has been installed (& hopefully uninstalled!), you may find a couple of registry entries related to the MS Installer. I'm considering this "fair use" (same as MUI Cache, Prefetch etc.)

If you're using "calibrePortable.ini" in the calibrePortable main directory (to redirect the library) the installer will detect it & change the "calibreDirectory" entry to "App\Calibre2". I could have left the directory name as it was but wanted to keep it in sync with the app.

New files in $TEMP - cal*.tmp. Deleted on exit.

Languages added since 0.6.16 -

Afrikaans

Korean

Latvian

That's all, folks!

0.6.16 Dev Test 1 (2009-10-07):

calibre updated to 0.6.16. No issues.

0.6.12 Dev Test 1 (2009-09-17):

calibre updated to 0.6.12.

Automatic language switching is now working (see install notes).

0.6.11 Dev Test 1 (2009-09-08):

calibre updated to 0.6.11. No issues.

0.6.10 Dev Test 1 (2009-08-29):

calibre updated to 0.6.10.

Launcher now backs up the default local library directory as the location has changed since 0.6.8.

Known Issues:
Due to the nature of Qt's use of the registry, if you use any of the apps below at the same time as calibre Portable & don't close them in reverse order, registry keys will be left behind and/or the original (local) keys will be overwritten. To avoid issues, never use them together!

The instructions are in "Other\Source\Readme.txt" but, to summarize...

Copy "Other\Source\calibrePortable.ini" to the same directory as "calibrePortable.exe". Edit it and set your path with the "LibraryDirectory=" entry. For example: "LibraryDirectory=Documents\Library". Note: no drive letter or trailing slash and make sure the directory exists before running calibrePortable.

EDIT: I just realised I had the wrong filename in the release notes above. I had "calibrePortableSettings.ini" instead of "calibrePortable.ini". Sorry for any confusion! Fixed.

I installed calibrePortable Dev Test 2 and all went smoothly. Imported some books, synchronized my Sony PRS-700 and did some searching on the library. All went just fine. It seems nothing is left behind.

Before anyone comes a running with pitch forks and flame torches please be aware that Prapper has previously noted that he appreciates being informed of updates. Can't find the post right now but believe it's in the thread for Glary Utilities.

I just had a look at calibre 0.6.18 and was disappointed to see that the installer creates an absolute slew of registry entries in HKCR and the app will not start (either standalone or with the current launcher) unless they are present. Bearing this in mind, I've decided not to upgrade to this version.

As the app is updated multiple times a month (sometimes twice a day!) and there are occasionally radical changes to the contents of the app directory, I'll keep an eye on it in the hope that something more workable will appear.

I'm still looking at this and it seems that it now needs the msvc90 files, that were previously just included in the app directory, to be installed. I've seen the info in the Blender thread here and the commments here but just putting the DLLs and manifest back in the app folder isn't working and just makes calibre crash. I'm not really sure where to go from here so any help would be much appreciated.

Have you thought about contacting the software author? In the past other PA devs have had success with this action and been able to develop the portable version in collaboration with the software author, optimizing portability.

Along with msvcm90.dll, msvcp90.dll and msvcr90.dll there should be a file Microsoft.VC90.CRT.Manifest with this content in it (the manifest was in an older version that I have, 0.5.14, and should ALWAYS be there):

Make sure that that's in App\calibre. Presuming that fixes it, tell 'em to stick it back in. (We had the same issue with Blender, 2.49a they forgot it and so broke all systems without it otherwise installed.)

OK, now I've actually looked at that bug tracker item... tell 'em they're compiling it wrong, could they please fix it up. It is definitely their fault; either that or there is some other issue, unrelated to VC90.

I'm glad the code can be portable again!
One thing, though. If this ever gets to the point where it could be a regular, non-beta app, will the fact that only admins can use it be a problem? I know that was one of the issues discussed regarding the .Net-based apps.

Calibre Portable 0.6.23 seems to not be able to have alternate locations for the library. I've tried a few times X:\Documents\Miscellaneous\E Books as the address but then it doesn't load the library on start up and I check preferences and it's been changed back to X:\PortableApps\calibrePortable\Data\library

I'm guessing this is hard coded into the launcher. Is it possible to make it so that other locations can be used or does this create to many headaches with the coding?

Also Microsoft Visual C++ 2008 installs the first time as it should but doesn't have the query come up on future runs on the same pc. Does that mean the install is not being uninstalled correctly?

Hope I'm not stating the obvious here but you are using the INI to relocate the library? If you use the GUI it will revert back to the default. Copy 'Other\Source\calibrePortable.ini' to the root directory and change the 'LibraryDirectory' line. In your case it'll be -

LibraryDirectory=Documents\Miscellaneous\E Books

- which is tested and working here. I used that same path on first run (the launcher will create the folders if they don't exist). Is it not happening?

Regarding MSVC, it will appear in Control Panel-Add/Remove while calibre is running but should be removed on exit. If it's still there then no, it isn't being uninstalled. Could you check? You should also be getting a prompt from the Windows Installer when calibre exits - 'Are you sure you want to uninstall etc...?', which I presume you're not?

If it's still in Add/Remove when calibre is closed, perhaps you could uninstall it from there, open then close calibre and check again, just to confirm?

I hadn't checked the readme :o whoops. I was using the GUI to set it.
Your instruction for how to set the library location worked. Thanks

Unfortunately the MSVC uninstall pop up does not show and when checking the Add/Remove panel I found it is still installed It's a pity the dev made the modifications to the app requiring it. Have you thought of notifying them of the situation to see if they may oblige you by developing a workaround or changing the code to not require it?

I did contact them (link is a few posts above). I asked a straight question & got a straight answer. Chris Morgan's later post re: calibre not being compiled properly, well, I would have liked to have followed that up but I'm not qualified to have that conversation with them unfortunately

Not sure what caused the initial but most likely human error on my behalf. Anyway I uninstalled MSVC, ran Calibre which reinstalled it then when I closed I got the pop up to uninstall. So it works now but with the need for admin rights that kinda kills this advancing in stages of development

Can you elaborate on your "not being qualified to have that conversation"? Chris maybe able to help or discuss the issue directly with the dev team *fingers crossed* :p

So everything is working Thanks for testing btw, I thought I'd killed it with that install/uninstall thing. But yeah, admin rights, never mind. I don't think Qt apps are in with much of a shot anyway, are they? I might even update it now I know somebody is still using it

What I mean is, I know nothing about compiling programs. PA.c launchers, yes, a little bit, but that's as far as I go If Chris wants to put them right, then I'm all for it.

My Windows 7 64-bit system has the 32-bit and 64-bit versions of the Visual C++ 2008 SP1 Redistributable Package installed.

When 0.6.34 Development Test 1 is run from a standard user account it always exits with the message that Visual C++ 2008 is _not_ installed.

When I ran it as an administrator it installed the Visual C++ 2008 Redistributable Package before it ran Calibre. When I exited from Calibre the launcher left behind a mess in the root directory (the installation files for the Visual C++ redistributable).

from a standard user account it always exits with the message that Visual C++ 2008 is _not_ installed.

Now I look at it, that message is misleading, it should inform you that you aren't admin and therefore aren't allowed to install it (although in your case you shouldn't see it - see below). Fixed.

The launcher needs to check a separate registry key for MSVC SP1 which I wasn't aware of. Fixed.

As far as the leftover files go, when I was putting together 0.6.21 I had the same happen to me but couldn't reproduce it (and still can't). Does it happen consistently? If so, perhaps you could post a list of the files and I'll add a check/cleanup for it. I should have kept a record myself but didn't.

EDIT: I just realised, if I fixed it, you won't have to install MSVC. Which I hope is the case

I upgraded my USB Flash Drive to 0.6.36 Development Test 1 but this has not solved my problem.

Using a standard account I see the revised message about the need to install MSVC.

Selecting "Run as Administrator" from the PortableApps.com Menu results in the launcher installing its own version of MSVC. After I exit from Calibre the launcher exits and I find the following 24 files have been added to the root directory on drive C:

OK, thanks for the file list. I can clean those up but they only appeared here once so I wonder what causes it?

I did install SP1 here on XP and (after editing the launcher) calibre successfully detected it and ran without trying to install the bundled version. So the regkey must be different (I'm guessing) on either Win7 or a 64-bit system (or both). I can have a look at Win7 later but if it's a 64-bit thing then I might need some help as I don't have access to a 64-bit system. Is it installed by default on Win7?

I had a look at the launcher code to see how it detected MSVC. It reads a registry entry so I checked the MSVC SP1 entry using regedit.exe ... and found the UninstallString the launcher checks so the launcher should have found it OK.

I suspected it might be a 32-bit/64-bit problem so I tried this code fragment:

SetRegView 32
ReadRegStr $R0 HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Products\D20352A90C039D93DBF6126ECE614057\InstallProperties" "UninstallString"
SetRegView 64
ReadRegStr $R1 HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Products\D20352A90C039D93DBF6126ECE614057\InstallProperties" "UninstallString"
SetRegView 32
MessageBox MB_OK "SetRevgView 32 result: >$R0$R1
which resulted in a message box showing that the expected UninstallString was returned when SetRegView was set to 64 (when set to 32 an empty string was returned, i.e. message box showed >Sorry you're having problems
No need to apologize; I am learning something new by investigating this
Edit: the string returned when SetRegView is set to 64 belongs to the x86 version of MSVC 2008 SP1 (i.e. the 32-bit version). I used NSIS 2.45 to test my code fragment.

Thanks for all that helpful info. I've added checks for the 64-bit version of both MSVC packages but obviously, still being stuck in the slow lane here, I haven't been able to test. Both 32-bit versions are still fine though. Also, if MSVC is installed and any files are left in the root of the system drive they'll be removed (assuming drive is C:).

Regarding the wrong string being returned for SP1 64-bit, I don't think that should matter(?) as long as something is returned (ie: MSVC, whatever flavour, is installed so skip the bundled version).

I upgraded my USB Flash Drive to 0.6.36 Development Test 2 and found that I can now run Calibre as a standard user.

This means the new launcher was able to detect that my Windows 7 64-bit system already has the MSVC 2008 SP1 Redistributable Package installed.

The release notes say "Added checks for 64-bit versions of MSVC and MSVC SP1" but this is not correct. What the launcher is doing is checking for the 32-bit version of MSVC in both views of the registry; but this is probably too much detail. Perhaps all you need to say is that you've improved the checks for the 32-bit versions of MSVC and MSVC SP1.

According to regedit.exe the UninstallString for MSVC 2008 SP1 64-bit version is found using EFEE0228DC83E77358593193D847A0EC instead of D20352A90C039D93DBF6126ECE614057

Thanks for your work on this; I had not heard of Calibre until I came across this PortableApps.com version.

That's exactly the procedure I use to update this package. The reason it's behind at the moment is that the last couple of calibre versions have refused to start on my machine and I don't want to upload something that I haven't been able to test. I guess I've got some more investigating to do.

I wanted to note that when running Calibre from Windows 7 the installation of the C++ library is still offered despite it not being a requirement. Can I suggest adding code to detect OS before offering to install the library.

My brother Jon just committed a change to BPBible's make_py2exe.py script in its WebConnect branch, and I believe this will help the calibre team to have the proper manifest, as it includes it all. If you'd contact them with a link to these changes, I think they should be able to sort out the rest.

This software releases new versions more often then some people change socks.
Would it not be wise to colaborate with the author to get his software portable in a way it can easily be used with Portable Apps?

I'm a little curious about what the plans are for the future of this app. I use it on my desktop and updating it so often is a pain. They have a release weekly right? Not to mention the popup notification... Is every single release going to be done here on PA.c or just major ones?

You have to install on USB drive and/or desktop. If desktop just copy across.

Don't run the program! Instead go into resources sub-directory (USB:\StandaloneApps\Calibre2\resources)and you will find calibre-portable.bat. You have to edit this file and run it from there to remember settings and locations.

I used custom locations, putting config and temp directories under Calibre2.

I still prefer the portableapp.com platform though. I'm using this version of Calibre as stand alone because a lot of new features has been added since 0.7.52. New plugins engine requires version 0.7.53 and newer.

The developer has built in portable features into recent versions. You have to install on USB drive and/or desktop. If desktop just copy across.

Which is wonderful in theory, assuming one has administrative rights on a machine to be able to run the Calibre installer in the first place. The developer closes any and all feature requests for either an installer that doesn't require admin rights ("This is not worth the effort for me personally. If some one else wants to implement it, I will be happy to supply any needed guidance. If so, re-open the ticket and we can discuss it."), or providing a preconfigured portable download. So I'm stuck with using the PortableApp version; this is not a bad thing, I just wish it were updated a bit more often.