-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add setting to run Lantern on system startup #175
Conversation
It looks like this still has all the windows service code from code.google.com/p/winsvc in there even though it's not used @atavism . |
@myleshorton Ah, thanks. I just removed it. |
log.Errorf("Could not get Lantern directory path: %q", err) | ||
return | ||
} | ||
err = gowin.WriteStringReg("HKCU", RunDir, "value", lanternPath) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These registry calls still succeed if not running as admin, is that right? Might be worth testing with a full installer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I verified with regedit. Good point though we should test these changes with the full installer though
I get this build error on windows:
Indeed that package is empty! |
Shoot now I get:
So sorry looks like gowin actually uses winsvc? Seems a little unfortunate but probably OK. |
) | ||
|
||
const ( | ||
RunDir = `Software\Microsoft\Windows\CurrentVersion\Run` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: it seems like this should just be a local variable in CreateLaunchFile since it's not used anywhere else and just adds to the global state otherwise.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, true. I usually prefer declaring constants at the top of a file regardless, but I went ahead and moved it inside the function body.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool yeah I guess its partly stylistic.
On Apr 14, 2015 8:05 AM, "atavism" notifications@github.com wrote:
In src/github.com/getlantern/launcher/launcher_windows.go
#175 (comment)
:@@ -0,0 +1,38 @@
+// Package launcher configures Lantern to run on system start
+package launcher
+
+import (
- "github.com/kardianos/osext"
- "github.com/luisiturrios/gowin"
- "github.com/getlantern/golog"
+)
+const (
- RunDir =
Software\Microsoft\Windows\CurrentVersion\Run
Yeah, true. I usually prefer declaring constants at the top of a file
regardless, but I went ahead and moved it inside the function body.—
Reply to this email directly or view it on GitHub
https://github.com/getlantern/flashlight-build/pull/175/files#r28335161.
Thanks on the winsvc front. I still am not sure what's going on, but if I build the installer from this branch using:
The resulting installer does two odd things:
Both make it seem like it's using an old version of the UI. Do you see the same things @atavism? This could also be related to cache settings -- it's possible the browser's just caching the old copy of the UI. Oh, also, I can't see to get it to affect the registry. I also checked, and there aren't any stray 2.0.0-beta5 tags lying around that might make it point to the wrong version. |
@myleshorton Yeah, this was happening to me too at some point. Did tarfs update the |
OK @atavism this issue with the outdated UI on Windows is gone for me now, but it's unfortunately still not successfully updating the registry when I toggle the auto-start setting. |
Actually it looks like the auto-start checkbox is controlling stats reporting for me. The logs show:
Oddly clicking either checkbox on or off seems to always turn stat reporting off. This is also in Firefox so could be related to that and not the browser. I'll check Chrome on Windows. |
@myleshorton You pulled in the latest changes, right? Are you looking for the registry key in |
It's not actually turning stat reporting on/off.. that just means config updates are propagating. those messages are always printed. |
Hey thanks @atavism. Actually, it looks like it's correctly turning it on but just not off. |
Changes Unknown when pulling abf0488 on launcher into * on valencia*. |
@myleshorton Thanks. Just fixed another issue with the path we were using.
|
OK this is working for me. I'm going to merge since the test failure has been fixed on valencia (ui resources again). |
Add setting to run Lantern on system startup
https://github.com/getlantern/lantern/issues/2344