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

Assumptions are made about application name #23

Closed
adam-lynch opened this issue Aug 20, 2014 · 8 comments
Closed

Assumptions are made about application name #23

adam-lynch opened this issue Aug 20, 2014 · 8 comments
Milestone

Comments

@adam-lynch
Copy link
Collaborator

I downloaded a ZIP called something like abc-123.zip into os.tmpdir().

runInstaller then assumed the executable was at <tempdir>/abc-123/abc-123.exe but unpack actually had unzipped the contents directy into the temp directory and my executable is called nw.exe so the path should've been <tempdir>/nw.exe.


node-webkit-builder and therefore grunt-node-webkit-builder (since it is now built on top of node-webkit-builder) supports custom naming of / a few different name types for the executables.

See the following from the node-webkit-builder readme:

options.appName

Type: String
Default value: false

The Name of your node-webkit app. If this value is set to null, it will autodetect the name form your projects package.json. This will be used to generate a plist file for mac.

options.appVersion

Type: String
Default value: false

The version of your node-webkit app. If this value is set to null, it will autodetect the version form your projects package.json. This will be used to generate a plist file for mac.

....

options.buildType

Type: String or function
Default value: default

How you want to save your build.

  • default [appName]
  • versioned [appName] -v[appVersion]
  • timestamped [appName] - [timestamp];
  • A function with options as scope (e.g function () {return this.appVersion;} )

And nwutils/nw-builder#30 (comment)


So how can we handle this? I'm willing to help as much as I can, but what do you think we should do?


Related: #20

@adam-lynch
Copy link
Collaborator Author

I guess the packages property section could be something like:

"packages": {
   "win": {
       url: "...a.zip",
       execPath: "this/is/relative/to/the/root/of/the/zip/exec.exe",
       size: "1000000"
   }
}

@edjafarov edjafarov added this to the 0.0.4 milestone Aug 22, 2014
@edjafarov
Copy link
Collaborator

As i get it main question is how the packages should look like.
It's quite a mess in updater.
what should we see inside the package?
my guess is:
mac: appName.app
win: appName/*
linux: appName/*
@adam-lynch what you think?

@adam-lynch
Copy link
Collaborator Author

We have to support whatever node-webkit-builder supports right?

Which means for example the exe could be named anything on Windows. The name of the exe doesn't have to be the same as the name of the ZIP either.

We might need a way of specifying what the .exe is called. You could make the restriction that the executable has to be at the root of the ZIP. So then you could have:

"packages": {
   "appName": "hello",
   "win": {
       url: "...a.zip"
   },
   ...
}

So then it would look for hello.exe in the Windows ZIP, hello.app in the mac one, etc. Then if you want, you can override it:

"packages": {
   "appName": "hello",
   "win": {
       url: "...a.zip",
       execName: "world.exe"
   },
   ...
}

So for mac, it'll look for hello.app but for Windows, it'll look for world.exe.

What do you think?

@edjafarov
Copy link
Collaborator

hmmm, could we assume that executable is not changing?
In that case we would get it with process.execPath right? So we do not need to specify exec name.
What is important for us is to have a single folder inside. To be exactly sure that we are copying only required files.
For example when you extract new version in temp folder. We wouldn't copy whole temp dir to the existing app folder.
So We would have only one requirement - packages for mac and windows should contain a single folder that named as an app.

sounds reasonable?

@adam-lynch
Copy link
Collaborator Author

hmmm, could we assume that executable is not changing?

Hmm, no. We've ours named nw.exe because of nwjs/nw.js#199 which prevents native modules from working on Windows unless it is called nw.exe. So, when this is fixed, we'll rename ours to appName.exe. Also, think that a company rename / rebrand their app.

For example when you extract new version in temp folder. We wouldn't copy whole temp dir to the existing app folder.

I'm not sure I'm completely getting what you mean, but it makes me think, what about those .dlls, etc. that node-webkit-builder gives us? What if they change? (I don't know much about them)

So We would have only one requirement - packages for mac and windows should contain a single folder that named as an app.

I'm not sure I understand what you mean.

@edjafarov
Copy link
Collaborator

I'm not sure I understand what you mean.

Nevermind, you are right, if executable could change we need to define it somehow.
manifest might be the right place.
so, do it:)

@adam-lynch
Copy link
Collaborator Author

If we're doing it, should have the restriction that the app already has to be at the root out the ZIP? Or can it be anywhere?

So if we allow Windows users for example to say the app is nw.exe, do we allow them to say a/b/nw.exe? (Relative to root of the ZIP)

@edjafarov
Copy link
Collaborator

I guess it could. Though we need to be aware that we need to know exactly what is the app folder
to be able to copy it properly.

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

2 participants