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

Why the name I pass to AutoLaunch constructor is not be used? #92

Open
kingeaglewang opened this issue Jan 22, 2019 · 4 comments · Fixed by #126
Open

Why the name I pass to AutoLaunch constructor is not be used? #92

kingeaglewang opened this issue Jan 22, 2019 · 4 comments · Fixed by #126
Assignees
Milestone

Comments

@kingeaglewang
Copy link

  • The target platform(s) the problem occurs on (Linux, Mac, Mac App Store, and or Windows):
  • Node version (run node -v):
  • auto-launch version:
  • The options you're passing to auto-launch:
  • Are you using NW.js or Electron?
    • If so, which version?
    • If you're using Electron, are you using auto-launch from the main process or a renderer process?
  • Can you reproduce this with a simple Hello World example app?
  • If needs be, would you be able to provide us with a simple app (as simple as possible) which reproduces the problem?

In your code in the AutoLaunch function,
you call this.fixOpts();
After this function, the name we pass will become another value.

In the fixOpts, I find author changes the this.opts.appName.
But I don't know why to do this.
If I comment out these code, then the name written in Registry will be what I pass.

@kingeaglewang
Copy link
Author

In fixOpts, I comment out part of the code.
Like below,

AutoLaunch.prototype.fixOpts = function() {
var tempPath;
this.opts.appPath = this.opts.appPath.replace(//$/, '');
if (/darwin/.test(process.platform)) {
this.opts.appPath = this.fixMacExecPath(this.opts.appPath, this.opts.mac);
}
// if (this.opts.appPath.indexOf('/') !== -1) {
// tempPath = this.opts.appPath.split('/');
// this.opts.appName = tempPath[tempPath.length - 1];
// } else if (this.opts.appPath.indexOf('\') !== -1) {
// tempPath = this.opts.appPath.split('\');
// this.opts.appName = tempPath[tempPath.length - 1];
// this.opts.appName = this.opts.appName.substr(0, this.opts.appName.length - '.exe'.length);
// }
// if (/darwin/.test(process.platform)) {
// if (this.opts.appName.indexOf('.app', this.opts.appName.length - '.app'.length) !== -1) {
// return this.opts.appName = this.opts.appName.substr(0, this.opts.appName.length - '.app'.length);
// }
// }
};

I just wonder if this is OK or not.

@Connum
Copy link

Connum commented Mar 4, 2019

I noticed the same thing... Without changing anything in the package's code (it obviously is a flaw that needs to be addressed, but the package doesn't currently seem actively maintained...), you can just overwrite the value after initialisation:

AutoLauncher.opts.appName = 'YourAppName'

@adam-lynch
Copy link
Contributor

Please see that we're looking for contributors / maintainers: #64.

I'm happy to give access to people who are willing to help improve things, merge pull-requests, close issues, etc.

@Oxalin Oxalin added this to the 6.0.0 milestone Mar 19, 2024
@Oxalin Oxalin self-assigned this Mar 19, 2024
@Oxalin
Copy link
Collaborator

Oxalin commented Mar 22, 2024

Partially fixed in upcoming 6.0.0-rc.2. However, still used under macOS and I think I understand what was the purpose of this "clean up". It is not so much a clean up, but a fix when needed for some scenarios. It should have been documented and better applied per OS.

Other improvements to come.

@Oxalin Oxalin linked a pull request Mar 22, 2024 that will close this issue
@Oxalin Oxalin linked a pull request Apr 6, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants