maforget / ComicRackCE

A Community Edition for the legendary Comic Book Manager ComicRack. ComicRack is back from the dead.
GNU General Public License v2.0
343 stars 34 forks source link

Installer configuration #20

Closed Totengeist closed 10 months ago

Totengeist commented 10 months ago

Here is a mostly functional installer script utilizing NSIS and ComicRack's original setup script. There are some issues to resolve and a few questions to answer.

Notes:

Issues/questions:

maforget commented 10 months ago

I have 0 experience with NSIS, so I will trust your expertise. I didn't expect to be able to use the script as is. I taught most was junk.

Here are some remarks:

Answer to your questions:

00005

Totengeist commented 10 months ago

Thanks for the feedback! This is my first time working on an existing project, so the feedback is very helpful.

  • You stated that you changed it so that the version info doesn't repeat, there seems to be a lot of repeat still. Any way so that we can change it once in a variable and it get distributed through out.

  • Can we automate the file list at all? Some files have been removed like LinqToTwitter, but are still there (you should update your master before doing a fork, you will probably need to do a rebase). A lot were added (that are missing) just by updating the libraries and you didn't see the quantity that were added while I was testing new PDF libraries. This is bound to be updated even more by changing and updating stuff like the OpenGL library. Everything in the Release folder should be included. We shouldn't have to update the script continuously for each change.

I already converted the version number to a variable and removed LinqToTwitter. Are you only looking at the first commit? I'll look into loading files automatically. I know Inno Setup can do that and I can't imagine NSIS not having that, too.

  • We can have scripts that are run after the build, in the post-build event. Like I said my knowledge is limited, but my guess is that we could have script that will fill the install script itself, like files or version number.

I was going to look into doing that once I've figured everything else out. I've done this in Python. We should be able to do something similar with batch files or something.

  • Keep in mind that this will be build by Github, so we will need to make certain that the components needed are available to be installed as github workflows. If not it will need to be scripted, either in the workflow file or a batch file that will be called after it is build. My workflow would be to go to the release action in Github and run the workflow, enter the version number (or other variable) and it will create a release with the file linked.

  • Don't be afraid to update your framework or tooling instead of trying to keep the script intact and keeping old versions.

  • We could remove the component selection and install all ressources like textures, languages, but some people will like to disable start menu and the such.

  • We will need to create an uninstaller. I was guessing that it was pretty much created automatically when doing the installer (the ones I tried did).

I may end up switching to Inno Setup if I can't get it working properly in NSIS. Inno Setup does the uninstaller automatically, and I figured NSIS would do this, too. We can always switch back in the future if we need to.

maforget commented 10 months ago

I've looked into the Visual Studio Installer and honestly it looks way easier. The files and dependencies get auto filled, set file associations.

Totengeist commented 10 months ago

I hadn't heard of that. I'll look at that tomorrow!

Totengeist commented 10 months ago

I switched from NSIS to Inno Setup. I looked at Visual Studio Installer, but many people said MSIs had more problems with difficult-to-track-down errors. The installer is similar to the previous ComicRack one and has all the same options except for optimizing.

Let me know if there's anything you feel needs changing. I ran the nightly workflow on my repo and it seemed to work fine.

The file association isn't fully complete, though. I'm not sure how accurate it is, so I'm gonna do more testing with it. I think it's complete enough for the nightly if people get antsy.

maforget commented 10 months ago

Looks good, a lot more readable. I believe we should have at least the file association, since for "those" people, it's one of the prime reason, like for installing plugins would be worse. For the SupportedTypes, you are using the wrong type, I don't see a lot of program using it, but it's in the MS Documentation wouldn't hurt. You need to also add the App Path.

For the Setup Icon you should use the "uninst_103.ico", it's the original installation icon.

Did you create the file yourself or did you use a tool, if so which one?

For the File Association (I've attached a reg file with all the changes I could think of): ComicRack.reg.txt

For Comics (.cbz, .cbt, .cbr. cb7, .cbw) Name: cYo.ComicRack Description: eComic Icon is the second icon (it should be the second one ,1) open => Open eComic with ComicRack open command => "%1"

For the list Name: cYo.ComicList Description: eComic List Icon should be the 3rd one (,2) open => Import eComic List into ComicRack open command => -il "%1"

For the plugin Name: cYo.ComicRackPlugin Description: ComicRack Plugin Icon should be the last one (,3) open => Install Plugin into ComicRack open command => -ip "%1"

maforget commented 10 months ago

Also the Help & Script folder are missing,

Totengeist commented 10 months ago

Thanks. As I've been thinking more about it, I've realized a few things I missed. Will continue to work on it. I thought I'd done a file comparison, but I think that was the old NSIS installer setup.

Totengeist commented 10 months ago

I think the last main issue to resolve now is .NET Framework check and download. I've found the information I need. It'll just take me a bit to get it working and I'll need to set up a VM without .NET Framework 4.8 to verify.

maforget commented 10 months ago

You used with the import & Install plugin ComicRack CE, but not with the eComic "Open eComic with ComicRack". Let's be consistent.

Shouldn't the associate lines have a Components: associate if the persons chooses to not associate?

When I tested the other version it permitted to install without Admin access, what would happen if it was required to install the .NET Framework in that case, since that would need Admin access. Would it prompt for it automatically and failing if not given access?

Totengeist commented 10 months ago

When I tested the other version it permitted to install without Admin access, what would happen if it was required to install the .NET Framework in that case, since that would need Admin access. Would it prompt for it automatically and failing if not given access?

This happens when it is already installed. If you uninstall first, that option will come back. Since the .NET install has it's own installer, it should elevate itself. I'll test this in my VM once I can set it up. I'll fix the consistency issue and the association option.

Should unchecking "Associate eComic extensions" mean it makes no changes to the registry, or should it still make some changes? For example, leaving in the SupportedTypes, allows adding ComicRack to the Open with... dialog.

image

maforget commented 10 months ago

I agree that we should keep the Open With functionality. Pretty much anything that is in the Application specific section should stay. But I think we should add the correct icon to the default open action so that if we do Open with later, the correct icon would be there.

Root: HKA; Subkey: "Software\Classes\Applications\{#MyAppExeName}\DefaultIcon";    ValueType: string; Flags: uninsdeletevalue; ValueData: """{autopf}\{#MyAppName}\{#MyAppExeName}"",1"

We should also remove the .cbl & .crplugin from the SupportedTypes since they won't work with the default open command.

Also how did you have ComicRack Community Edition shown in the open with window, I tested your last setup and it only gives ComicRack. Did you add something else? I was looking at how the FriendlyAppName worked to fix that. Since there is no details in the exe, I am guessing is the problem. I will have to check to add at least some info in the .res file.

maforget commented 10 months ago

Yeah I've tested with adding this reg value and it shown the app name correctly.

[HKEY_LOCAL_MACHINE\Software\Classes\Applications\ComicRack.exe]
"FriendlyAppName"="ComicRack Community Edition"
Totengeist commented 10 months ago

Yeah I've tested with adding this reg value and it shown the app name correctly.

[HKEY_LOCAL_MACHINE\Software\Classes\Applications\ComicRack.exe]
"FriendlyAppName"="ComicRack Community Edition"

Yeah, I have that in a local commit. I hadn't pushed it yet since I wanted to wait for your answer.

Totengeist commented 10 months ago

I also found information about signing the installers that might work with the workflows. I need to do some testing to verify.

maforget commented 10 months ago

Wouldn't that need a certificate that costs hundreds of dollars per year?

Totengeist commented 10 months ago

Yeah, apparently it does now. I didn't realize they require Organization Validation now. Nevermind.

maforget commented 10 months ago

I've changed back the installer to the original type so it overrides them. The problem is that it sometimes writes the association in the HKCU, when you close the Preferences dialog (I believe if it exists already). So even when installing the new program it still opens with the OG ComicRack. That way it will override the default open command and the existing HKCU association will open the new one even if set to cYo.ComicRack.

I still have the problem is that the OG ComicRack calls himself ComicRack Community Edition in the OPen With, because we added the FriendlyAppName for ComicRack.exe. Might need to rename the exe itself to something else.

Totengeist commented 10 months ago

Yeah, unfortunately the registry references everything by the filename and not the path or some other unique identifier. I wasn't sure how difficult changing the executable filename would be, so I left it. I didn't want to break anything by accident.