rcmaehl / NotCPUCores

Work, Play, Stream - Without the Stutter. Download using Releases button below
Other
749 stars 44 forks source link

Add installer #97

Closed micwoj92 closed 3 years ago

micwoj92 commented 3 years ago

I put this quickly in like 30-40 minutes after following comments by @AnonymerNiklasistanonym in #13 (btw Niklas, could you review or maybe any advice you have? Seems like you are much more advanced in this than me)

This fixes #13

To create you have to have NotCPUCores.exe in same directory as this script.

micwoj92 commented 3 years ago

I marked is as draft for now. I think it also needs ability to install 32 bit version. Will test your changes soon.

AnonymerNiklasistanonym commented 3 years ago

I added in a very rushed fork (because I didn't know anything about NSIS any more and have only limited time plus I have not used Windows for more than an hour in a year) the automatic ability to install 32/64 bit versions based on the found arch. Also it seems that the registry installation path thing did not work so I fixed that too.

EDIT: I now also added icon support for the installer and the Windows start menu shortcut but for it to look better most probably the .ico file needs to support more sizes, otherwise it could look blurry on some Windows PCs.

Things that I removed were the non admin elevation because I did not find an easy way to enable both types of installations (local/program files) so I just stuck with the program files installation since users that only want it local could just use the exe directly I believe.

@micwoj92, if you meant that the 32/64 bit exe selection should happen manually this doesn't help at all (just ignore me, I was just interested in relearning NSIS again) besides if you would want to use a checkbox (because than there is one in the file commented out that you could use) but I guess multiple sections would be the way to go since you can disable them if the arch is not found and react to when they are selected to disable the other one (although this requires some brain to do because it seems complicated in my opinion - but I got something similar to work some years ago so it's 100% possible).

Anyways I checked your code and it looked good (you will see that my fork of your code still looks very similar) but I am not somebody who really knows anything about this topic right now. Most of the changes in my fork are not really important because they just enable debugging, use more variables because I like it this way more or add unnecessary comments that I added to understand the code again and verify that it works.

A quick link to the diff and to get it to run you need to create two .exe files called NotCPUCores_x64.exe and NotCPUCores_x86.exe in the root of the repository and then everything should just work.

Also an important disclaimer - It should work with x86 computers but because I don't have one I could only test it by setting the If arch=64 to IfNot arch=64 - so it's probably best if someone with such a computer checks if it really works.

micwoj92 commented 3 years ago

Hey, thanks for the answer man, maybe could you make pull request from your fork and I will close this one? Or should I apply your patches on my fork so you get credited as well?

As for the 32/64 selection. It should happen automatically.

AnonymerNiklasistanonym commented 3 years ago

I could create a pull request but you can also apply my patches if this is faster or more ease of use for you (your decision since you are the guy behind the PR while I just reviewed it and gave my hopefully helpful opinions).

AnonymerNiklasistanonym commented 3 years ago

Wait can I not just make a pull request to your branch which can then be merged into this PR? Sorry for the question but I have never done something like this.

micwoj92 commented 3 years ago

I think you should create pull request. I won't have access to pc next couple hours.

I could create a pull request but you can also apply my patches if this is faster or more ease of use for you (your decision since you are the guy behind the PR while I just reviewed it and gave my hopefully helpful opinions).

If you didn't comment on #13 then I probably wouldn't have started this PR.

micwoj92 commented 3 years ago

Wait can I not just make a pull request to your branch which can then be merged into this PR? Sorry for the question but I have never done something like this.

Oh yeah, this should be possible on github

micwoj92 commented 3 years ago

Ok, It seems like I was able to do it :D