redshift-tray icon indicating copy to clipboard operation
redshift-tray copied to clipboard

"More settings" doesn't work since last update

Open tmarkov opened this issue 5 years ago • 26 comments

After update yesterday I get an error message "Failed attempt to launch program or document" rstray.ini every time I try to open "more settings".

Can you give me a default rstray.ini and tell me where to put it?

(I have installed rstray using chocolatey)

tmarkov avatar Dec 21 '18 08:12 tmarkov

This is a permissions problem created by the Chocolatey package. Redshift Tray is portable by itself and needs to be able to write rstray.ini to its own folder. Currently, with a Chocolatey installation, it has no permissions to do that. This will render all settings of Redshift Tray useless (i.e. they will be reset on every start). Chocolatey is not supported by me, please contact the creator of the package.

Also, this package removes redshift.exe, so Redshift Tray will do nothing.

ltguillaume avatar Dec 21 '18 12:12 ltguillaume

I (hope I) have notified the creator of the package.

ltguillaume avatar Dec 21 '18 12:12 ltguillaume

I don't see how the previous version (1.7.x) could have worked via Chocolatey, either: although it did include redshift.exe (so the gamma adjustments would have worked), none of the settings could have been saved. @dimqua are you still managing the Chocolatey package?

ltguillaume avatar Dec 21 '18 22:12 ltguillaume

Thanks, knowing it was a permission problem, I was able to resolve the issue by starting rstray as administrator. I do need to restart it as administrator every time I want to change settings, but it reads them fine without admin access (I could edit settings without admin access in 1.7.x).

I do have a redshift.exe coming from the redshift chocolatey package, so the gamma adjustment works.

tmarkov avatar Dec 21 '18 23:12 tmarkov

Strange, It didn't work for me in a virtual machine. Either with or without the "Run as administrator" option set, no rstray.ini was created.

ltguillaume avatar Dec 22 '18 00:12 ltguillaume

No response from @dimqua so far...

ltguillaume avatar Dec 25 '18 16:12 ltguillaume

@dimqua I've sent you another message, please respond. You're breaking Redshift Tray with your Chocolatey package, I'd like to resolve this.

ltguillaume avatar Jan 21 '19 15:01 ltguillaume

@ltGuillaume sorry for the delay. I can't reproduce:

  1. Run rstray.exe;
  2. Change some settings from More settings menu, rstray.ini is created.

When I change settings and restart the program, all my changes persist.

dimqua avatar Jan 22 '19 05:01 dimqua

@dimqua That's only the case if you run rstray.exe as Administrator. Run the command "rstray" from a non-elevated Command Prompt and you'll see what I mean.

ltguillaume avatar Jan 22 '19 14:01 ltguillaume

@ltGuillaume not sure if this can be fixed, since Chocolatey rules do not allow to use admin rights for portable packages, at least this is what the support team told me.

dimqua avatar Jan 23 '19 03:01 dimqua

@dimqua That would be ridiculous. They keep talking about portable applications and how they should work as Chocolatey packages and in the end, it doesn't? Then please take RSTray off of Chocolatey, because it doesn't work properly and will only annoy people.

ltguillaume avatar Jan 23 '19 11:01 ltguillaume

@dimqua For clarification: RSTray does NOT need administrative rights to run. The only problem is that Chocolatey (or your packaging) places it in a folder that can only be written to if the program is run as administrator. If Chocolatey has some other folder RSTray can be put into that doesn't need these permissions, then it'll run fine. If it doesn't, then that's the strangest design fault I've seen in a while.

ltguillaume avatar Jan 23 '19 11:01 ltguillaume

It did work in 1.7.x... Did the rstray.ini use to be in the user folder before, but got moved to the rstray.exe folder?

tmarkov avatar Jan 23 '19 12:01 tmarkov

That's impossible unless Chocolatey has changed its behavior since. You probably just ran RSTray as administrator the first time, so it created rstray.ini. But it won't save any changed settings if you run RSTray without admin privileges, even after rstray.ini has been created. No settings-related behavior has changed in RSTray since 1.7.x

ltguillaume avatar Jan 23 '19 20:01 ltguillaume

It seems I've found a solution. Could you please test the latest version? choco install rstray --version 1.8.1

dimqua avatar Jan 26 '19 17:01 dimqua

No, that doesn't work:

  1. It will not run Redshift, because you delete it. The dependency on the Redshift package will not work this way: RSTray will look in its own folder for redshift.exe, nowhere else (and this will not change).
  2. Chocolatey does not create a shim to rstray.exe, so typing "rstray" in a Command prompt won't run RSTray anymore.

ltguillaume avatar Jan 26 '19 18:01 ltguillaume

  1. Why it works for me this way then? I don't mind to keep it though.
  2. Fixed.

dimqua avatar Jan 26 '19 18:01 dimqua

  1. I doubt that. Was the process redshift.exe (not just rstray.exe) actually running? Be sure to add the file redshift.exe.ignore so that it remains compatible with the Redshift package.
  2. Cool
  3. Is it allowed to use C:\tools?

Thought I fixed it, not true... Chocolatey is awful, both in architecture and documentation. Yuck.

ltguillaume avatar Jan 26 '19 18:01 ltguillaume

Was the process redshift.exe (not just rstray.exe) actually running?

Yes, the shim from C:\ProgramData\Chocolatey\bin. But when bundled version is present, it's used instead.

Is it allowed to use C:\tools?

Yes, for example, git.portable package uses it.

(I've re-uploaded the package to make it uninstall correctly.)

dimqua avatar Jan 26 '19 19:01 dimqua

Was the process redshift.exe (not just rstray.exe) actually running? Yes, the shim from C:\ProgramData\Chocolatey\bin. But when bundled version is present, it's used instead.

Hmz, I didn't think that'd work (it shouldn't, really), but it's possible that I didn't get redshift.exe to run, simply because I tested in avirtual machine.

Cool, then I guess it's fixed! I just tested it, seems to be working fine now, including uninstall. Thx!

ltguillaume avatar Jan 26 '19 20:01 ltguillaume

@dimqua Would you be so kind to update the Chocolatey repo to v1.9.3? A couple of versions ago I added your repo to README.md :-)

ltguillaume avatar Aug 27 '19 01:08 ltguillaume

I think this issue reappeared again? chocolatey installs rstray to C:\ProgramData\chocolatey\lib\rstray\tools for me.

karolzlot avatar Dec 10 '22 11:12 karolzlot

Chocolatey v1.2.1
Installing the following packages:
rstray
By installing, you accept licenses for the packages.
Progress: Downloading rstray 2.2.2... 100%

rstray v2.2.2 [Approved]
rstray package files install completed. Performing other installation steps.
Extracting C:\ProgramData\chocolatey\lib\rstray\tools\redshift-tray.zip to C:\ProgramData\chocolatey\lib\rstray\tools...
C:\ProgramData\chocolatey\lib\rstray\tools
 ShimGen has successfully created a shim for redshift.exe
 ShimGen has successfully created a shim for rstray.exe
 The install of rstray was successful.
  Software installed to 'C:\ProgramData\chocolatey\lib\rstray\tools'

Chocolatey installed 1/1 packages.
 See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).

karolzlot avatar Dec 10 '22 11:12 karolzlot

@dimqua Can you help out?

ltguillaume avatar Dec 10 '22 17:12 ltguillaume

AM sorry if i missed anything in conversation but will give you default path of rstray.ini when installs it using chocolatey. /Path/ >>C:\ProgramData\chocolatey\lib\rstray\tools > rstray.ini Just a tip sometimes when it feels messy just close the rstray make sure nothing persistent sticks (like keep bright or anything when program is off) Open the rstay.ini using admin privilege everything will work fine. Regards

High-Flyer avatar Sep 26 '23 12:09 High-Flyer

@High-Flyer Yeah but this isn't how it's supposed to work, that's for sure.

ltguillaume avatar Oct 08 '23 07:10 ltguillaume