TranslucentTB / TranslucentTB

A lightweight utility that makes the Windows taskbar translucent/transparent.
https://translucenttb.github.io
GNU General Public License v3.0
15.86k stars 1.13k forks source link

Start before logging in finishes #135

Open L0laapk3 opened 6 years ago

L0laapk3 commented 6 years ago

It would be nice to make the program start before logon, so the task bar is right from the start instead of a couple seconds after logging in.

One way I personally found to achieve this is, is to add the program to the end of

HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\Userinit

. However, this would run into problems with multiple users if the program is not installed properly in a way that all users can access it..

olliecheng commented 6 years ago

Hmm... This could also get messy, as the next version of TTB will have a Windows Store release and we're not sure if UWP supports such a thing. Thanks for the intel, tho!

L0laapk3 commented 6 years ago

Yeah, I'm definitely not saying that that is the proper way it should be implemented. Just pointing out the flaws of the current implementation and what I ended up doing on my device. But it could indeed get very messy if the exe is missing.. :p

sylveon commented 6 years ago

It definitely won't, registry access is blocked in the Desktop App Converter. However, I don't see why we couldn't make this a feature in a desktop version. With conditional compilation directives, this is easily manageable.

I'll have to see how Wallpaper Engine does it, because as @L0laapk3 mentioned, the UserInit solution can blow up quite bad if the program is removed but the registry key isn't changed back. There's also the problem of some programs conflicting each other for control of this key.

ghost commented 6 years ago

I know this is quite late, but I managed to do this via the windows event scheduler, this starts the program before you sign in

L0laapk3 commented 6 years ago

@StbCG I've found that while this does get pretty close, it still starts 0.5-1 seconds after logging in on my machine.

ghost commented 6 years ago

@L0laapk3 What settings have you applied for the event? Mine starts before I log in 95% of the time

L0laapk3 commented 6 years ago

Just selected start on logon for every user. But i have about 6-7 of those in total and they start one by one

sylveon commented 6 years ago

Instead of adding additional installer, program and uninstaller complexity for a feature that will rarely be used, I decided to make this a project of its own.

https://github.com/sylveon/EarlyStart

I've tested it with TranslucentTB, and it works fine. (It still sets the current directory as System32, so don't forget your --config)

ethanhs commented 6 years ago

I think this should be documented here at least.

L0laapk3 commented 6 years ago

I'll start by saying that this is just my personal opinion. I'm having some trouble wording this without sounding rude, apologies.

I feel like this functionality is too 'core' to the program to leave to another program, after all, Almost every user will have auto startup enabled. It seems a bit weird to leave the user a choice between the program doing a sloppy job at it, or installing another program to do it, especially because theres no real advantage (that im aware of) of the current way that it is done other than maybe that the exe comes with no installer. (Which I assume the windows store will hide anyways). In my personal opinion, the way wallpaper engine handles it is superior, and should be implemented into the program itself, some time in the future.

sylveon commented 6 years ago

There's not much advantages of using the service method either, because the only thing you gain is a few seconds more at startup where the taskbar is themed. Which most people won't really care about.

And the disadvantages of this are great - you have to write installer code to install the service, write some messy code using the Windows service api to detect the service in the app, and some uninstaller code to remove the service. All of which are potential failure points.

Making it separate removes the need to maintain code in the main app, and the setup, and prevents a lot of potential bugs.

Plus, having a service running as NT-AUTHORITY\SYSTEM as the parent of a user session process is a potential security vulnerability.

For your concern about the sloppy startup system, it is much better in v4. The System32 bug has been fixed, among a few others.

olliecheng commented 6 years ago

I think that one way we could remedy this is to add a button inside TranslucentTB to automatically download EarlyStart, and to configure it to start TTB on startup. But I completely agree with Charles that this functionality should not be added to the core application, due to the overhead and complexity it adds.

maclanelf commented 4 years ago

it worked when shutdown then start,but it won't worked when restart directly,can you help me?

hello-smile6 commented 2 years ago

I feel like this should be optional to allow non-admin installs.

patrick-lindemann commented 1 year ago

For anyone stumbling over this, I've found a way to start TranslucentTB earlier on Windows using the built-in Task Scheduler:

First, you need to retrieve the full path to TranslucentTB executable (TranslucentTB.exe).

After you found the executable, right-click TranslucentTB.exe and select Copy as path.

Now, follow these steps:

  1. Open the Task Scheduler.
  2. Click on Create Task... on the right panel.
  3. Name the task, e.g. TranslucentTB.
  4. Create a new trigger under the Triggers tab and set the Begin the task to At log on. You can set this rule for any user or for a specific user only.
  5. Create a new action under Actions tab, select Start a program as the action and copy the path that you obtained in step 1 into Program/Script.
  6. Click Ok to save the task. It should now appear at the bottom of the Task Scheduler Library table.

The next time you sign in, TranslucentTB will already be running without any startup delay.

sylveon commented 1 year ago

Store Version: The executable is located in the folder C:\Program Files\WindowsApps\28017CharlesMilette.TranslucentTB_. Since the WindowsApps folder is protected by default, you need to obtain the access rights by following this guide.

Don't do that. Not only do you risk breaking the OS by getting perms for WindowsApps, it will break your task after updates (as you've mentionned), and breaks TTB's package identity. If you use the Store version, point the task to the app execution alias at %LocalAppData%\Microsoft\WindowsApps\ttb.exe.