It is currently November 21st, 2018, 3:01 pm

Relative Path and ContextMenu command

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

Relative Path and ContextMenu command

oZone » June 3rd, 2018, 12:30 pm

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: 18350
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Relative Path and ContextMenu command

jsmorley » June 3rd, 2018, 1:21 pm

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: 57
Joined: May 14th, 2018, 4:46 pm

Re: Relative Path and ContextMenu command

oZone » June 3rd, 2018, 1:45 pm

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: 18350
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Relative Path and ContextMenu command

jsmorley » June 3rd, 2018, 3:38 pm

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: 18350
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Relative Path and ContextMenu command

jsmorley » June 3rd, 2018, 3:46 pm

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: 57
Joined: May 14th, 2018, 4:46 pm

Re: Relative Path and ContextMenu command

oZone » June 3rd, 2018, 4:08 pm

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: 1790
Joined: November 24th, 2011, 1:42 am
Location: Ohio

Re: Relative Path and ContextMenu command

Brian » June 4th, 2018, 5:15 am

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