It is currently February 19th, 2020, 11:46 am

RunCommand

Share and get help with Plugins and Addons
Godmode_Off
Posts: 4
Joined: January 28th, 2015, 7:34 am

Re: RunCommand 1.0

Post by Godmode_Off »

Feature request: Support for "Run as specific user/admin".

Thanks for this awesome plugin! :-)
User avatar
jsmorley
Developer
Posts: 20250
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: RunCommand 1.0

Post by jsmorley »

There is likely something you can do with the "runas" command in Windows.

https://technet.microsoft.com/en-us/library/cc771525.aspx

I imagine that you are going to get UAC popups with this, almost certainly if you "runas" admin, but I think it should work.
Yincognito
Posts: 759
Joined: February 27th, 2015, 2:38 pm

Re: RunCommand 1.0

Post by Yincognito »

I just tried this plugin in Windows 8.1 x64 (VirtualBox VM) and the log gives error 126 : "Unable to load \RunCommand.dll". The spelling is correct as far as I can tell, the plugin is the correct x64 version and I tried even putting the .dll file in the main Rainmeter plugins' folder (along with the proper modifications in the code) to no effect. Also the plugin appears to be loaded just fine in the About/Plugins tab. There is a "!CommandMeasure not supported" error too in the log, but I suspect it's related to the fact that the plugin "couldn't be loaded".

Thing is, the same code works fine on Windows 7 x64 (no VM) and on Windows XP SP3 x86 (VM):

Code: Select all

[MS_RunCommand_CPUCoresBits]
Measure=Plugin
Plugin=Plugins\RunCommand.dll
Parameter=wmic CPU where DeviceID='CPU0' get DataWidth,NumberOfCores
State=Hide
OutputType=ANSI
IfCondition=1
IfTrueAction=[!CommandMeasure MS_RunCommand_CPUCoresBits "Run"]
UpdateDivider=-1
RegExpSubstitute=1
Substitute="\S+\s+\S+\s+(\S+)\s+(\S+)\s+":"\2 x \1b"
Anyone happens to know why?
User avatar
jsmorley
Developer
Posts: 20250
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: RunCommand 1.0

Post by jsmorley »

Yincognito wrote:I just tried this plugin in Windows 8.1 x64 (VirtualBox VM) and the log gives error 126 : "Unable to load \RunCommand.dll". The spelling is correct as far as I can tell, the plugin is the correct x64 version and I tried even putting the .dll file in the main Rainmeter plugins' folder (along with the proper modifications in the code) to no effect. Also the plugin appears to be loaded just fine in the About/Plugins tab. There is a "!CommandMeasure not supported" error too in the log, but I suspect it's related to the fact that the plugin "couldn't be loaded".

Thing is, the same code works fine on Windows 7 x64 (no VM) and on Windows XP SP3 x86 (VM):

Code: Select all

[MS_RunCommand_CPUCoresBits]
Measure=Plugin
Plugin=Plugins\RunCommand.dll
Parameter=wmic CPU where DeviceID='CPU0' get DataWidth,NumberOfCores
State=Hide
OutputType=ANSI
IfCondition=1
IfTrueAction=[!CommandMeasure MS_RunCommand_CPUCoresBits "Run"]
UpdateDivider=-1
RegExpSubstitute=1
Substitute="\S+\s+\S+\s+(\S+)\s+(\S+)\s+":"\2 x \1b"
Anyone happens to know why?
It certainly works fine for me, and as far as I know everyone else, on Windows 8.1 x64, so I'm sure it is something related to your VirtualBox environment. Do you get the same thing if you run Rainmeter "As administrator"?

You might want to try:
Use the sysinternals utility Process Monitor http://technet.microsoft.com/en-us/sysinternals/bb896645 from Microsoft to trace all file access while your dll is trying to load. With this utility, you will see everything that that dll is trying to pull in and usually the problem can be determined from there.
Yincognito
Posts: 759
Joined: February 27th, 2015, 2:38 pm

Re: RunCommand 1.0

Post by Yincognito »

I'm sure it is something related to your VirtualBox environment
Yes, well, that's the logical thing to say, I agree, but how can this be when the same code, the same files, the same VM settings work under Windows XP VM?

But...to give some feedback :

1. "Run as administrator" doesn't make a difference : same thing.
2. Running only the "problematic" skin and filtering in Sysinternals Process Monitor for ProcessName=Rainmeter.exe and Path<contains>RunCommand throws 2 "unsuccessful" results:

Code: Select all

Date & Time:	5/12/2015 4:12:54 PM
Event Class:	File System
Operation:	CreateFileMapping
Result:	FILE LOCKED WITH ONLY READERS
Path:	C:\Program Files\Rainmeter\Plugins\RunCommand.dll
TID:	1396
Duration:	0.0000027
SyncType:	SyncTypeCreateSection
PageProtection:	
and

Code: Select all

Date & Time:	5/12/2015 4:12:54 PM
Event Class:	File System
Operation:	CreateFileMapping
Result:	FILE LOCKED WITH ONLY READERS
Path:	C:\Users\Zedd\AppData\Roaming\Rainmeter\Plugins\RunCommand.dll
TID:	1396
Duration:	0.0000036
SyncType:	SyncTypeCreateSection
PageProtection:	
Note : other "operations" on the same files are all "successful"!

I copied again the 64-bit version of the dll to make sure I didn't somehow mistaken it with the 32-bit version : same effect. I checked for permissions, owner, etc. of the .dll, all are fine, granting everyone permission and stuff (it doesn't matter, anyway, since obviously I am an Administrator in the VM and beyond, but did that just in case) : same effect. I restarted the OS in the VM to make sure the file wasn't opened by another program (again, it doesn't matter, since the file was not opened for writing, just reading, but did that just in case) : same effect. I will try restarting the "real machine" too, but I doubt it will make a difference.

Frankly, I really don't know why this happens - it's a mystery to me. All the other plugins work just fine, so, again, it is obviously not the VM environment. If it was, then the other plugins would experience the same problems - which they don't. What baffles me is that the plugin is loaded fine in the About/Plugins tab, so logically, it should also work elsewhere...
User avatar
jsmorley
Developer
Posts: 20250
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: RunCommand 1.0

Post by jsmorley »

Don't know. The logic of this to me is:

1) RunCommand works fine for me, and we have never had any report of it not working on a native Win8.1 x64 installation.

2) Thus, there is something different about your system. This could only be a few things in my view:

a) You are running Win8.1 in a VM. That is obviously a likely candidate, since it is a clear difference between our systems, but one doesn't want to jump to conclusions. On the other hand, assuming it can't be this just because "other plugins" work or that it works in an XP VM is also jumping to conclusions. I do NOT believe that "so, again, it is obviously not the VM environment." is a valid final conclusion. The fact that a VM "emulates" a lot of hardware is always a concern. I'm inclined to believe that if you were to install Rainmeter and your skin on a native Win81. x64 installation of Windows, chances are it would work fine.

Until you can come back and say "I just formatted a computer and installed a native version of Win8.1 x64 and it still doesn't work", the VM is still my favorite candidate. If it runs in native Win8.1 but not in a VM Win8.1 then it IS the VM. If it won't run in either for you, then it CAN'T be the VM. It's binary.

b) Somehow Rainmeter is seeing a version of the RunCommand.dll that is causing some kind of 32bit vs. 64bit conflict. I know you have double checked that, but I'd be a fool to ignore the possibility, since I didn't actually set it up myself on your system. Once again, I don't know that the VM environment can't play a role in this.

c) There is some kind of file permission or execution security problem with either the dll or something it is dependent on. Again, I know you have explored this, but see b) above...

d) While I think it is unlikely, it is possible that there is some issue with the C++ runtime libraries being used by your VM. Might be worth downloading and installing the latest Visual Studio 2013 runtime libraries for C++, just to be certain.

Nothing else feels logical to me right off. The problem boils down to:

It works fine for me and everyone else on Win8.1, but not for you. What is different for you? You need to identify differences, and positively eliminate them one at a time, until you get to the Sherlock Homes answer of "Once you eliminate the impossible, whatever remains, no matter how improbable, must be the truth."

P.S. It is not my intention to avoid helping you if I can, but I do have to say that nobody on the Rainmeter team has done any rigorous testing of any part of Rainmeter running in a "virtual machine" version of Windows, and we don't in any way warrant that it will work correctly that way. The fact that VM's emulate hardware, and that they use "virtualization" to run 64bit OS on 32bit hardware and visa versa makes me uneasy about promising anything.

Brian, who wrote RunCommand, is out of pocket for a week or so, and he may have some ideas when he gets back. I have no idea what specific Windows API or OS system calls the plugin is using, but clearly something the plugin is doing when it is "executed" is blowing up in your specific environment.
Yincognito
Posts: 759
Joined: February 27th, 2015, 2:38 pm

Re: RunCommand 1.0

Post by Yincognito »

Ok then, I don't want to argue about it.

I will never ever install a native Win 8.1 on my computer, since I really hate that OS - looks like cartoons for the kids with that Metro thing, but I agree with you that it will work on a native Win 8.1 system, since the code already did in your Win 8.1.

I know the "method" of Sherlock - I've used it countless times in computer related "investigations", I'm not a begginer on this. But for me, the problem boils down to : if all the apples are kept in baskets and all the baskets are in the fridge, but one apple is rotten while the others are not, then the "issue" must be the apple, not the basket or the fridge, granted the baskets have the same parameters and the fridge is functional.

Anyway, I'm not designing this for VMs, so I can live with it, knowing that the code is fine and works on native systems. I might call a friend to also confirm.

"Problem" closed then.

P.S. I sent you the dump file for the other topic, maybe it will help you figure out things.
Last edited by Yincognito on May 12th, 2015, 3:12 pm, edited 1 time in total.
User avatar
jsmorley
Developer
Posts: 20250
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: RunCommand 1.0

Post by jsmorley »

Here is what I would do to try and eliminate at least some possibilities:

1) Load the "illustro default" Layout in Rainmeter. We want only default skins running
2) Exit Rainmeter
3) Find and delete ALL copies of RunCommand.dll, anywhere on your system. Get rid of it entirely. Both from the VM partition and the native OS partition. No RunCommand.dll anywhere on your computer.
4) Reboot your physical computer
5) Restart the Win8.1 x64 VM

6) Start Rainmeter
7) Install this .rmskin
TestRunCommand_1.0.rmskin
Does it work?
You do not have the required permissions to view the files attached to this post.
Yincognito
Posts: 759
Joined: February 27th, 2015, 2:38 pm

Re: RunCommand 1.0

Post by Yincognito »

Yeah, it does...except the skin returns "Windows is ------". Which means that it doesn't, of course :confused:

I did all that you asked. Deleted, purged, everything. Not only in the VMs (both XP and 8.1), but also on my native Win 7 x64 (aka the "real machine").

This is starting to become really funny. I bet Sherlock himself would be baffled by this...
User avatar
jsmorley
Developer
Posts: 20250
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: RunCommand 1.0

Post by jsmorley »

Yincognito wrote:Yeah, it does...except the skin returns "Windows is ------". Which means that it doesn't, of course :confused:

I did all that you asked. Deleted, purged, everything. Not only in the VMs (both XP and 8.1), but also on my native Win 7 x64 (aka the "real machine").

This is starting to become really funny. I bet Sherlock himself would be baffled by this...
Yeah, but you are not getting any crash or runtime error, so that is a huge step forward.

So now what errors if any are in About / Log and what if anything is being returned by the measure in About / Skins? Nice thing about RunCommand is that sometimes it will return error text generated by the console program it is running. (assuming RunCommand actually is executing the command in the OS)