Page 1 of 1

XnView on removable drive - drive's contextual menu

Posted: Mon Jan 11, 2010 9:33 am
by aapapapa
XnView placed on a USB drive or an optical media.

Drive has autorun.inf at its root.
autorun file has to generate some options in the drive's contextual menu.

These contextual menu positions lead to xnview invocation with the -ini and -slide parameters.
How should the autorun syntax look?
It has to work at least on Vista and Windows 7.

I guess, they will be the shell/<item>/command items.
But how exactly have they to be?

Re: XnView on removable drive - drive's contextual menu

Posted: Mon Jan 11, 2010 3:05 pm
by ckv
aapapapa wrote:XnView placed on a USB drive or an optical media.

Drive has autorun.inf at its root.
autorun file has to generate some options in the drive's contextual menu.

These contextual menu positions lead to xnview invocation with the -ini and -slide parameters.
How should the autorun syntax look?
It has to work at least on Vista and Windows 7.

I guess, they will be the shell/<item>/command items.
But how exactly have they to be?
Usual autorun.inf context menu looks like this:

Code: Select all

shell\uniquestring=Menu text
shell\uniquestring\command=some.exe -param
With xnview -ini and -slide parameters:

Code: Select all

shell\xnview=&XnView slide
shell\xnview\command=xnview.exe -ini xnview.ini -slide someslide.sld
But here it gets interesting with Windows Vista and possibly with Windows 7, there's a bug in the context menu processing that causese all programs runned from the context menu to get a wrong working directory (C:\WINDOWS\System32). This breaks all relative paths in the command line as they are no longer looked relative to the drive path.

To fix the problem you need to use full paths in the command line or you could use a little program I wrote called Autorunner, it will correct the working directory before runing the context menu program.

When using Autorunner you simply add 'autorunner.exe' to the beginning of the command entry:

Code: Select all

shell\xnview=&XnView slide
shell\xnview\command=autorunner.exe xnview.exe -ini xnview.ini -slide someslide.sld