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

add ability to specify path to custom installer.nsi #51

Merged

Conversation

vxsx
Copy link
Contributor

@vxsx vxsx commented Oct 24, 2015

#50

@@ -27,6 +27,7 @@ var Builder = {
options = options || {};
options.log = options.log || console.log;
options.out = options.out ? path.resolve( process.cwd(), options.out ) : process.cwd();
options.nsiTemplate = options.nsiTemplate || path.join( __dirname, 'templates/installer.nsi.tpl' );

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please follow coding style here ( aligned = )?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oops, missed this one, fixed

@stefanjudis
Copy link
Contributor

@vxsx

Except a little coding style issue this looks good to me.

The only thing I'm asking myself is, if it is needed to pipe a custom NSI file trough the templating engine.

It feels a bit weird - doesn't it? But maybe it's just me. :)

@vxsx
Copy link
Contributor Author

vxsx commented Oct 24, 2015

it is a bit weird now that I think about it, but I think it's better to keep things consistent with the default template. and after all, enduser can easily hardcode things in it if he wants, templating is not that intrusive :)

@stefanjudis
Copy link
Contributor

@vxsx

I just got my head around it a bit more. I think we can do it like that - but are there ways around setting a custom file?

I'm thinking of several config options or even areas where user can place command easily.
I'm just thinking out loud here - but maybe we can brainstorm a bit. :)

@vxsx
Copy link
Contributor Author

vxsx commented Oct 26, 2015

I think there are pros and cons to each approach.

1. Options and customisable areas in config:

pros

some level of control over things
sounds simpler for the end user

cons

have to add every little bit as an option/area to the config (only a con if there are a lot more options, depends if the demand is high or low)
depending on demand (or perfectionism) - takes time to implement

2. Custom file:

pros

complete control
easy to implement (PR is right here :D)
not really a problem to add areas and options on top

cons

have to know what you're doing (harder for the end user)
maybe there would be issues about "how do i do this or that"
adding options on top may not be very good for the api
going away from this initial solution would be a backwards incompatible change


i probably missed lots of things

For me second approach is better, because digging in the source code and copying and adapting a template is fairly easy for me personally, and I kinda like the complete control thing. It also means that a problem is solved with minimum effort. Longterm i think combining approach 2 and 3 would probably be better in general, but it's gonna cost more time, and the answer is really "it depends".

Up to you to decide :)

@Brankub
Copy link

Brankub commented Oct 26, 2015

+1 for @vxsx changes. Have to change .tpl file in electron-builder folder to add register settings.

@FinalAngel
Copy link

👍

@vxsx
Copy link
Contributor Author

vxsx commented Oct 30, 2015

did you have a chance to think about the path you want to take with this @stefanjudis ?

options = options || {};
options.log = options.log || console.log;
options.out = options.out ? path.resolve( process.cwd(), options.out ) : process.cwd();
options.nsiTemplate = options.nsiTemplate || path.join( __dirname, 'templates/installer.nsi.tpl' );
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As this windows specific this should be treated inside of the windows installer file, or?

@stefanjudis
Copy link
Contributor

Okay, okay. :bowtie:

I see a few people want this - so let's do it. :)

Sorry for the delay on my side. :(

I made a few notes to the actual PR.
And I will have a further look, when these are done.

One additional note I have is, that we should try to engage people using a different nsi template to think of their nsi template and ask themselves if it might be useful for others.

There might be some additions which we can add to the "base"-template.

Thanks a lot folks for your effort. :)

@vxsx
Copy link
Contributor Author

vxsx commented Nov 1, 2015

@stefanjudis updated the PR. not entirely sure about what to add to the readme beside the config option though

@stefanjudis
Copy link
Contributor

@vxsx Alright. Looks good. :)

Thanks a lot. ;)

stefanjudis added a commit that referenced this pull request Nov 1, 2015
add ability to specify path to custom installer.nsi - fix #50
@stefanjudis stefanjudis merged commit 5a36c42 into electron-userland:master Nov 1, 2015
@vxsx
Copy link
Contributor Author

vxsx commented Nov 1, 2015

@stefanjudis thank you :)

@stefanjudis stefanjudis added this to the v2.1.0 milestone Nov 1, 2015
@stefanjudis stefanjudis self-assigned this Nov 1, 2015
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

Successfully merging this pull request may close these issues.

4 participants