It is currently March 28th, 2024, 1:34 pm

Relative Path and ContextMenu command

Report bugs with the Rainmeter application and suggest features.
Post Reply
oZone
Posts: 154
Joined: May 14th, 2018, 4:46 pm

Relative Path and ContextMenu command

Post by oZone »

I have some issues with using relative path in FileView plugin ContextMenu command.
Properties command is working fine.

below is part of my code

Code: Select all

[Variables]
Launcher1_1_File=#PROGRAMPATH#..\SomeFolder\SomeFile.exe

[LauncherContext]
Measure=Plugin
Plugin=FileView

[Launcher1_1]
Meter=IMAGE
MeterStyle=sLauncher
RightMouseDownAction=!CommandMeasure "LauncherContext" "ContextMenu [#[#CURRENTSECTION]_File]"
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Relative Path and ContextMenu command

Post by jsmorley »

oZone wrote:I have some issues with using relative path in FileView plugin ContextMenu command.
Properties command is working fine.

below is part of my code

Code: Select all

[Variables]
Launcher1_1_File=#PROGRAMPATH#..\SomeFolder\SomeFile.exe

[LauncherContext]
Measure=Plugin
Plugin=FileView

[Launcher1_1]
Meter=IMAGE
MeterStyle=sLauncher
RightMouseDownAction=!CommandMeasure "LauncherContext" "ContextMenu [#[#CURRENTSECTION]_File]"
You really can't do that. The ContextMenu command in FileView acts on the file currently selected by the plugin, not a file you can specify in the bang.
oZone
Posts: 154
Joined: May 14th, 2018, 4:46 pm

Re: Relative Path and ContextMenu command

Post by oZone »

But according to https://docs.rainmeter.net/manual-beta/plugins/fileview/#ContextMenu
I can manually define file path, and if I use absolute path it will work
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Relative Path and ContextMenu command

Post by jsmorley »

Ah, you are right. Sorry I missed that... I'm not sure then. I think we might need brian, who is much more familiar with the plugin, to weigh in. It is possible that the ContextMenu option doesn't work with relative paths.

Code: Select all

[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1

[Variables]
Launcher1_1_File=#PROGRAMPATH#..\Speccy\Speccy.exe

[LauncherContext]
Measure=Plugin
Plugin=FileView

[Launcher1_1]
Meter=IMAGE
W=50
H=50
SolidColor=255,0,0,255
DynamicVariables=1
LeftMouseUpAction=[!CommandMeasure LauncherContext "ContextMenu [#[#CURRENTSECTION]_File]"]
Cannot open context menu for "C:\Program Files\Rainmeter\..\Speccy\Speccy.exe" (@Working\Test.ini - [LauncherContext])
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Relative Path and ContextMenu command

Post by jsmorley »

This works for me...

Code: Select all

[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1

[Variables]
Launcher1_1_File=%PROGRAMFILES%\Speccy\Speccy.exe

[LauncherContext]
Measure=Plugin
Plugin=FileView

[Launcher1_1]
Meter=IMAGE
W=50
H=50
SolidColor=255,0,0,255
DynamicVariables=1
LeftMouseUpAction=[!CommandMeasure LauncherContext "ContextMenu [#[#CURRENTSECTION]_File]"]
So I'm using the value of the DOS variable %PROGRAMFILES%, which for me is C:\Program Files, and don't need to use a relative path from the Rainmeter folder.
oZone
Posts: 154
Joined: May 14th, 2018, 4:46 pm

Re: Relative Path and ContextMenu command

Post by oZone »

I know about this, but I am using Rainmeter in portable mode on USB.
Currently I am using workaround with variable #PROGRAMDRIVE#, but I still prefer relative path from Rainmeter folder.

It's interesting that Properties command doesn't have this issue.
User avatar
Brian
Developer
Posts: 2673
Joined: November 24th, 2011, 1:42 am
Location: Utah

Re: Relative Path and ContextMenu command

Post by Brian »

oZone wrote:It's interesting that Properties command doesn't have this issue.
A file's context menu and properties are accessed in different ways, but both send the path directly to Windows to process. Apparently the properties version resolves relative paths, while the other does not.

This has been fixed for the next beta.

-Brian
Post Reply