Skip to content
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

isHidden argument does not hide the app #65

Open
akashnimare opened this issue Nov 9, 2017 · 7 comments
Open

isHidden argument does not hide the app #65

akashnimare opened this issue Nov 9, 2017 · 7 comments
Assignees

Comments

@akashnimare
Copy link

node-auto-launch - latest
OS - macOS/Linux

I'm using this in an electron app here. It successfully launches the app on system startup but the isHidden option is not working and it doesn't hide the app even on setting it to true. Here is the relevant code -
https://github.com/zulip/zulip-electron/blob/hidden-on-startup/app/main/startup.js
https://github.com/zulip/zulip-electron/blob/80c37fabb8bf05521c4df47552f82bcd3d41db5d/app/renderer/js/components/webview.js#L73

@adam-lynch let me know if I'm doing anything wrong here.

@adam-lynch
Copy link
Contributor

Hmm I'm not sure. It works in a simple app for me here. I've just published 5.0.2 which fixes the path problem. Just in case, could you try it with 5.0.2 and no path argument?

@akashnimare
Copy link
Author

I doubt it will fix the problem since it successfully launches the app on startup only the hidden mode doesn't work. Let me test it on 5.0.2.

@king-d-dev
Copy link

Please have you been able to get it to work now, I'm also facing similar issue using a windows 10 device.

@yafp
Copy link

yafp commented Jul 4, 2019

I am using 5.0.5 and just tested if the hidden option is working for me on windows 10.
In fact it doesnt.

The registry key looks like that:

"C:\path\to\my\app.exe" --hidden

@rbestardpino
Copy link

rbestardpino commented Jul 5, 2021

Hi! I am facing the same issue for an electron app. Did any of you guys found a solution or workaround?

I am using:

Windows 10 Build 19043,
Node 14.16.1
Electron 13.1.4
auto-launch 5.0.5

My code is straightforward and taken from the documentation:

// Calling autolaunch from main process
const autoLaunch = new AutoLaunch({
  name: 'My App',
  path: app.getPath('exe'),
  isHidden: true,
})

autoLaunch.isEnabled().then((isEnabled) => {
  if (!isEnabled) autoLaunch.enable()
})

The registry in \HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Run gets created OK including the --hidden flag.

I don't know where the flags are defined so I used Process Explorer as detailed here to see if I could find any flag that could work. I found the openAsHidden flag, but it didn't do anything (I don't know if is a valid flag tbh). If someone knows where flags are defined I'll be thankful.

I also tried with cmd.exe /c start /min "path to app" (info). But it did not work either.

Finally, I tried with some arbitrary flags: -silent, /background. Neither of those did anything.

I'm out of ideas 😢, any help is welcome.

Thanks, Rodrigo.

@Oxalin
Copy link
Collaborator

Oxalin commented Mar 19, 2024

For documentation purpose: the argument "isHidden" doesn't magically hide the application except with AppleScript. For all other cases, it adds the argument when the application is called at launch, but the application still needs to deal with it in a way or another.

Using Electron, this could be done my calling some available methods for Windows and macOS though. But if IRC, this is not available under Linux. And for any other situation without Electron, the dev would still needs to do something of the argument to hide the application on startup.

@Oxalin Oxalin self-assigned this Mar 19, 2024
@Oxalin
Copy link
Collaborator

Oxalin commented Mar 19, 2024

Clarify how it works in README.md

@Oxalin Oxalin changed the title auto launch does not hide the app isHidden argument does not hide the app Mar 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants