Running a batch file at the end of Pack and Go

Started by ubacher, October 20, 2023, 09:04:34 PM

Previous topic - Next topic

ubacher

I am trying to run a batch file when P&G finishes. It does not seem to run - and I have no idea why not.
The log file gives no indication.
The P&G window closes after running(!)

I specify the full path to the batch file.
"E:\Imatch DB BACKUP\Append db Name.bat" TESTARG
The batch file should asks for a name but it does not open a cmd window.
I tried also giving an argument instead

(And YES, the checkmark is set
and running the batch file manually works)

Batch file code attached.


Mario

#1
Check the Pack & Go log.
P&G logs: Running post-pack command: ...
And if the command was executed successfully, P&G logs: Command succeeded.
Else it logs Command failed with code [number].

Pack & Go runs cmd.exe with the /C parameter as an invisible console. To avoid unnecessary "flashing" when a command is run at the end. This is not really designed for command line interactivity like prompting for user input or similar.

I'll have a look to check if running the command in "visible" mode makes any difference.
Pack & Go works that way since it was initially released, so I think the demand for this is pretty low.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

ubacher

ImatchPackAndGoLog.txt shows at the end Logfile closed but nothing about a command
being executed.

ImatchPackandGo.txt shows on the last line Duration: 00:00:35.


PS: I am trying to add the name of the db to the P&G file. Else I have only the size of the file
to distinguish between the used db's.

Mario

Just made a check. I see

Running post-pack command: "C:\batch\pack-and-go-finalize.bat"

in the IMatchPackAndGoLog.txt file and the batch file is run correctly.

QuotePS: I am trying to add the name of the db to the P&G file. Else I have only the size of the file to distinguish between the used db's.

Pack & Go is a tool for transferring IMatch settings and databases from one PC to another. To make it easier to work with multiple computers. Packages are usually short-lived and thus you should remember which databases you've just included when you transfer them to another PC.
DO NOT use Pack & Go as a replacement for backups. Packages become invalid when you install a new IMatch version.

If you really need to do this and you produce packages with different databases and you need to maintain these packages for more than a few minutes, store the packages in different folders. You have control over the folder name. The package name is generated automatically.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

ubacher

I create backups for external storage. These may be recovered much later, on another computer and maybe
when another version of Imatch is in use.
I store the images, a copy of the used imatch installation file and the database file. P&G will provide me with
all the additional files (like scripts) and, should there be problems with the db file, I can recover.

This brings up the question: Does the Imatch installation file also include the required exiftool version?

And another question: Is a P&G file linked to the program version it was created with? Obviously, when new
features are introduced then an old P&G package won't record those.

Mario

#5
QuoteDoes the Imatch installation file also include the required exiftool version?
The IMatch installer also installs the matching ExifTool version.

QuoteAnd another question: Is a P&G file linked to the program version it was created with?

Yes. A new IMatch version may contain changed settings, updated, moved or removed apps etc.
Restoring a P&G package created with an older version on top of a newer IMatch version could have disastrous consequences.

The Pack & Go help states that in a yellow warning box:

QuoteIt is not supported to restore a Pack & Go package created with an older IMatch version on top of a newer version. Newer IMatch versions may introduce changes in the folder structure used by IMatch, and restoring an older package on top of that will cause problems.

Pack & Go also displays a message when you attempt to restore a package created with an older or newer version that is installed on the computer on which you run Pack & Go.
You have the option to continue or to unpack into a different folder to manually copy files or databases when needed.

Before I've introduced this check and error message, I've had tons of fun with users where apps were not working, settings were missing or corrupted etc.
And then I learned that they had restored very old Pack & Go packages on top of their brand-new IMatch installation. Causing duplicate apps in different folders, replacing apps, overwriting new settings databases with old versions...

Again: Pack & Go is NOT A BACKUP TOOL.
It says so in clear words in What Pack & Go Is Not? at the top of the Pack & Go help page.

I've only added the "backup" reminder to IMatch after learning that many users don't know how or never do any backups. And hope for the best. And I though, in such cases, having a Pack & Go package with the database is better than nothing.

Every week I get one or two emails from users who have lost all their data due to a disk failure, computer failure or theft. And who need to recover everything by hand, since they don't have a backup.

As we say here IT in Germany: "No backup. No mercy".
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook