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

Creating an installer for the Enhanced Edition #425

Closed
13 tasks
elishacloud opened this issue Apr 17, 2021 · 37 comments
Closed
13 tasks

Creating an installer for the Enhanced Edition #425

elishacloud opened this issue Apr 17, 2021 · 37 comments

Comments

@elishacloud
Copy link
Owner

elishacloud commented Apr 17, 2021

Creating this new ticket to keep track of the installer work. This is a continuation from the issue here on dxwrapper.

Here are the items I would like to see in the installer:

  • Installs the game into a specified folder
  • Offers an option for uninstalling the game
  • Adds a Start Menu folder and icon(s)
  • Installs the updated sh2pc.exe file
  • Installs the d3d8 module and associated .res and .ini files
  • Installs the essential files pack
  • Installs the image enhancement pack
  • Installs the audio enhancement pack
  • Installs the FMV enhancement pack
  • Installs DSOAL
  • Installs the optional game controller files (XInput vs. DInput)
  • (Bonus) Offers configuration options for items in the d3d8.ini file
  • (Bonus) Offers configuration options for the game controller
@Zombeaver
Copy link

These are all definitely doable, no problem.

For the configuration options in the d3d8.ini I'll just need to know what you want to be toggleable. This will be easy to accomplish with .bats and FART.

For the configuration options for the controller, this is going to kindof depend on what it is that you want to be configurable and how that's accomplished. I'll need some more info on that one. I'm not very familiar with XinputPlus. Historically I've always used AntiMicro.

@elishacloud
Copy link
Owner Author

For the configuration options for the controller, this is going to kindof depend on what it is that you want to be configurable and how that's accomplished.

For the controller options the configuration is explained here. Would be great to see options for the following:

  • Xbox controllers
  • PlayStation DualShock 2 & 3
  • PlayStation DualShock 4
  • PC DirectInput Gampad
  • PC XInput Gamepads

Here are the basics:

  • Add XInputPlus and reset RestoreSearchCamMovement in the d3d8.ini file for Xbox controllers, PlayStation DualShock 2 & 3, and PC XInput Gamepads.
  • Remove XInputPlus and set RestoreSearchCamMovement = 2 in the d3d8.ini file for PlayStation DualShock 4 and PC DirectInput Gampad.

@Zombeaver
Copy link

Oh yes, I already have that working now. I thought you meant like customizing the controls themselves. Swapping one to the other via shortcut is already done.

@Polymega
Copy link
Collaborator

Nice! I haven't had time to look over your launcher yet, Zombeaver, but I will soon. Sorry about that; I've been playtesting other things for the project at the moment.

I should mention Gemini is possibly looking into a revamp of controller support in the future. Something to hopefully broaden overall compatibility and restore vibration for various controller APIs. If this happens, I'm not sure what that will change for configuration options with something like this, but wanted to preemptively tell you.

@Zombeaver
Copy link

Okay, the project I'd been working on is now done so I'm shifting gears to work on this.

I'll still need to know:

  1. What options from the d3d8.ini do you want to be toggleable?

  2. What information do you want me to include in the readme? This will be shown during the installation process and will be accessible afterwards through the Launcher or in the Docs folder. If there's any links that you want to include, notes, thanks/credits, anything like that let me know.

I've been working on some artwork for the installer in the interim.

image

@Polymega
Copy link
Collaborator

Hi Zombeaver,

Something else we should discuss is the ability to check for updates to any given package and ask the user if they'd like to update the package. Some questions come to mind for this:

  • Do we combine the installer, launcher, and update checker all in one file/program?
    • If not, do we make them two pieces? One for the installer and the other as a launcher/update checker combo?
    • Or, @elishacloud, should the update checker be handled through the SH2E module whenever the game launches?

Between an installer and launcher, I think what should be tackled first is the installer; it's the more-requested feature between the two.

To answer your questions:

  1. For launcher settings, I'll need to sit down and comb through all the features in our project to hopefully filter it down to the essentials. There's a lot of toggleable features, and most of them the typical user won't ever adjust.

  2. I don't think we need any ReadMe files. Perhaps at the end of the installer, in the window that says the installation is complete, we also include a link or URL to our project site--or maybe ask if they'd like to visit the site as one of the choices [VISIT SITE] [OK] . In terms of info, everything they'd need is there, and keeping info updated on the site is easier than through documents.


I think it may be ideal to sit down with you and come up with needed or required screen prompts for things in the installer and launcher.

For example: For the installer, one of the first things that needs to be communicated to the user is that this installer does not include a copy of the base game; they must acquire this elsewhere.

For the screen that asks what packages they'd like to install, it'd be a checkbox list with all of them checked by default, and there would be a very short description of what each package provides.

When asked where the user wants to install the EE project files, it may also be ideal to have a sort of "safety check" for whatever directory they choose. Perhaps look for the sh2pc.exe file or other associated vanilla files and, if not found, warn the user that the installation directory they chose may not be the right folder.


For a workflow: Can we work on the installer first and break down the necessary windows/steps/prompts that should be included? Is there a way to mockup the how the installation prompt flow would look/work?

I imagine we'd need to have a specific naming and folder convention for the packages so the installer can work correctly when retrieving them to download/install. Let me know about this and we can get that figured out as well--create a sensible naming convention.

Thanks

@elishacloud
Copy link
Owner Author

* Or, @elishacloud, should the update checker be handled through the SH2E module whenever the game launches?

We could add the updater to either the launcher or into the game itself. The advantage of adding to the launcher is that we can make a button for it so the user can click it to update (makes the user feel good to get feedback saying that the code is up-to-date). Also, the code is a bit easier because we don't need to build code to exit and restart the game and then cleanup files from the last instance of the game.

However, the advantages to adding the code into the game makes it so that we can still update the files even if the users play the game directly rather than via the launcher. Also, I have already create the code for the updater so this eliminates the coding advantage of adding it to the launcher.

I am ok with whichever option we chose.

@Zombeaver
Copy link

Zombeaver commented Apr 19, 2021

Okay so I don't think we're on the same page here so I'm gonna back up for a moment and explain what I'm doing.

The packages I do are installers for the game, any needed patches, integrated use of virtual environments like PCem or DOSBox where needed (not relevant in this case), and adding in extra features like Reshade and custom controller support with Antimicro (not needed in this case). It creates start menu and desktop shortcuts as well and has a launcher that functions as a configuration panel for adjusting various things. The end result is akin to what you'll see if you use an installer from GOG. To be clear, the game is included. The only time that isn't the case is when I'm making patchers to add in features or fix problems for games that are currently commercially available in places like Steam or GOG - that isn't the case here. Now if you'd like me to create a patcher like that for your project that also has a launcher/configuration panel, I can do that too, but ultimately what I'll be releasing is the whole kit & caboodle.

You wouldn't need to host this on your site, and in fact I wouldn't be hosting it on my site either - everything I do is hosted on Archive.org (with a couple exceptions like my C64 Dreams project). You'd have an .exe, you run it, tell it where you want to install, it has the game and the Enhanced Edition patches baked in, it creates start menu and desktop shortcuts, and a configuration panel for turning features on and off. You start a shortcut and you're off.

  • Do we combine the installer, launcher, and update checker all in one file/program?

No, I have no way of facilitating this.

  • Or, @elishacloud, should the update checker be handled through the SH2E module whenever the game launches?

This sounds like a good idea to me.

Between an installer and launcher, I think what should be tackled first is the installer

The launcher is already done. It's included as part of the installation process. All I need to know at this point is which d3d8.ini options need to be toggleable so that I can add those in. As you said, there's a lot of stuff in there, most of which people are never going to touch, so if there's a reasonably sized list of things that you think people might actually want to toggle on and off, I can add those in. Other than that though, that's ready to go.

2. I don't think we need any ReadMe files. Perhaps at the end of the installer, in the window that says the installation is complete, we also include a link or URL to our project site--or maybe ask if they'd like to visit the site as one of the choices [VISIT SITE]

I ordinarily include things like Wikipedia links for the relevant game, homepages for emulators used, that kind of thing in the readme section, so in this case I'll just include a link to the Silent Hill 2 Enhanced Edition page there.

For the screen that asks what packages they'd like to install, it'd be a checkbox list with all of them checked by default, and there would be a very short description of what each package provides.

It will install them all, it won't be pick and choose. If people want to disable something, it'll need to be through the launcher to toggle certain things off in the .ini.

The things that @elishacloud enumerated in the initial post here are all things I can do. Most of what you're suggesting, however, is outside the scope of what I'm going to be able to help you with.

I can put together something for you to test out for yourself in the next day or so.

@The-King-of-Toasters
Copy link

I've been working on some artwork for the installer in the interim.

image

That looks pretty good! Do you happen to make and bundle 2:3 cover images in your installers? This could be used for #222 (see the comment at the bottom).

@Zombeaver
Copy link

That looks pretty good!

Thanks!

Do you happen to make and bundle 2:3 cover images in your installers? This could be used for #222 (see the comment at the bottom).

I don't typically do anything to an exact aspect ratio like that (I use a fixed height of 750 and then the width is proportional) but that wouldn't be a problem. The above is pretty close to that already so it wouldn't require much adjustment.

@Zombeaver
Copy link

Zombeaver commented Apr 20, 2021

Okay, so here's a preview version of the installer. This doesn't have adjustable options for d3d8.ini except for the Xinput vs Dinput swapper, but it won't be difficult to add those in once I have a list of what should be toggleable.

[EDIT: I've removed the link for the time being]

@Zombeaver
Copy link

@The-King-of-Toasters here's a 2:3 (600x900) version of the cover.

Silent Hill 2 Enhanced Edition Grid

@Polymega
Copy link
Collaborator

Sorry for the delay Zombeaver, my spare time has been swept up with playtesting these past days. May I ask you to send me a message through this contact form so I can get your email? I'd like to pick up the discussion there so we can bounce back and forth quickly with one another. Thank you
http://ratio.townofsilenthill.com/about/#contactme

@Zombeaver
Copy link

Sure, no problem. Sent.

@umbrellacorp53
Copy link

I love this image. Just wanted to pop in and say that.

@hgdagon
Copy link

hgdagon commented Jun 13, 2021

Hey, I worked on something like this a while ago. It could do pretty much everything listed here, except for maybe the controller-related stuff. The only roadblock I faced was the installer would need some sort of an info on the current versions of each module/enhancement pack. My installer would only download whatever the latest versions were at the time via a direct link, so no update check was ever implemented. It can detect the game disc in a physical drive, or browse to a drive/directory containing setup files, but would do the copying itself and the original installer was never run. After installation it would copy itself to the game directory and from there it would act like an updater (well, eventually)/Launcher/Settings editor(just a GUI for d3d8.ini).

Now, unfortunately I seem to have lost the latest version of the source code, and I don't have much free time on my hands promise I can do this again. However everything mentioned above was done by me within a day, so it shouldn't be too hard to recreate.

@Polymega
Copy link
Collaborator

Polymega commented Jun 14, 2021

Hi hgdagon,

Thanks for reaching out! For whoever helps us make an installer, I am happy to work with them to ensure packages would work correctly with any sort of update checker. (Such as changing how we package or name files for the downloads.)

I know you mentioned you've lost the source code, but can you describe a little more how your installer functioned? Is it a Python script? A batch script? An executable? Do you have previous builds that you could launch and share screenshots of?

In regards to functionality, Gemini has recently made a launcher for us that will be included in the next project update, so that should be taken care of (which also tackles the controller-related stuff). For remaining things, we'd be needing a standalone installer/updater next.

Some important things I'm looking for with an installer--like with the launcher we had made--are intuitiveness/simplicity, as little files as possible (possible to contain/run everything in a single exe?), and preferably a Windows-styled GUI (example), as PC users are naturally very familiar/comfortable with this UI.

@hgdagon
Copy link

hgdagon commented Jun 15, 2021

I'm gonna have to look for it, see if I can update anything on my free time. Everything was done in Lazarus/FreePascal and was 1 executable. I "borrowed" the installer UI from InnoSetup, which uses Pascal for scripting and is actually where I tarted before moving to proper Pascal.

@hgdagon
Copy link

hgdagon commented Jun 15, 2021

I found an old code and build from 06/06/2020, which literally contains these 2 pages

No actual copy/installing step is implemented, and most importantly the main UI showing the versions of modules installed and the d3d8.ini editor is completely missing, which, ironically is the part I spent most time on. This is a very early backup, and as such kind of useless. I clearly remember this wasn't even the final Installer UI.

@hgdagon
Copy link

hgdagon commented Jun 15, 2021

Also found this. This is just a test for "block" rendering of ini sections. Apparently, I was also testing multi-language interface, which I had completely forgotten about.

Still, very useless. The main issue now is still free time. I should reimplement everything, which should be easy and then take care of update checking.

@Polymega
Copy link
Collaborator

I "borrowed" the installer UI from InnoSetup

Nice. When I was doing my own research for how an installer could be made, Inno was on the top of my list, in regards to a familiar, clean UI.

Semi-related, but I also found someone who made a plugin which allows you to download package files via Inno (I'm assuming Inno cannot do that by default?). In the comments section of that page, someone discussed the possibility of it extracting the files for placement, as well. I don't know if it's of any use/importance, but figured I'd share just in case: https://mitrichsoftware.wordpress.com/inno-setup-tools/inno-download-plugin/

I found an old code and build from 06/06/2020, which literally contains these 2 pages

Looks great. It looks and feels like a regular Windows installer which is what we'd want.

The main issue now is still free time. I should reimplement everything, which should be easy and then take care of update checking.

No rush and no worries. All of us do this on our free time so there's no hard deadlines for anything we do 99% of the time. :)

But yes, if you'd be interested in revitalizing this let us know and keep us posted. Elisha and I would be happy to work with you to ensure it includes everything we'd need. I'm also happy to change how our download packages are saved out to work best with the installer/update checker. We can work that out when the time is right.

I would like to be involved with the "layout/flow" of the installer's UI, if you don't mind. It'd mostly be covering the main install steps we'd need and verbiage for each step. If you'd like to discuss more through email, feel free to send me a message here: http://ratio.townofsilenthill.com/about/#contactme

Thanks again!

@nipkownix
Copy link
Contributor

Is this being worked on by someone? I have a W.I.P version of a Inno-based online installer. Its working quite well for my personal use, but I could polish it up if you're interested in using it officially.

@Polymega
Copy link
Collaborator

Polymega commented Jul 8, 2021

Crazy timing! It is being worked on by @hgdagon and I just sent him notes on the current prototype build. However, we could use a little help with Inno progress bar/extraction functionality.

Do you know a good solution to show progress details of both downloading and extracting files through Inno? An an example: Download details being all the text you see in this image:

image

...and extracting details showing you what's currently being extracted from a ZIP archive.
Thanks!

@nipkownix
Copy link
Contributor

nipkownix commented Jul 8, 2021

Ah, I see.
My installer currently has a similar interface for the download step, since we're probably using the same plugin to handle that:

image

For the extraction step, I haven't found an easy way to handle it. We can't have an actual list of files being extracted with the plugins available right now.
A good solution I stumbled upon is this:

image

Two progress bars. The top one indicating how many components have been/will be extracted, and the bottom one showing which component we are currently extracting. Each component here is a zip file from the sh2e website.

For reference, these are the components my installer can download:

image

@hgdagon
Copy link

hgdagon commented Jul 8, 2021

Two progress bars. The top one indicating how many components have been/will be extracted, and the bottom one showing which component we are currently extracting.

Yeah, I'm also leaning towards this solution. What do you use for zip extraction (how do you get the output into the progress bar)? I'm thinking of using ISDone.
Also, do you know of any good methods of redirecting the console output of a command-line application to the progress bar? I need to filter the output of the application to only include the lines referencing the file currently being extracted and put that in the status message, and ProgressMax should probably be set manually. I'm currently looking through a few examples, but I wonder if you know a good, working method.

@Polymega
Copy link
Collaborator

Polymega commented Jul 8, 2021

My installer currently has a similar interface for the download step, since we're probably using the same plugin to handle that:

image

Which plugin is that? Those added details (file, speed, status, etc) would be useful to include.

And your solution for ZIP extraction: Does it "lock up" the installer as it performs the extraction process?

Thanks for sharing details for all of this and helping us along!

@nipkownix
Copy link
Contributor

Yeah, I'm also leaning towards this solution. What do you use for zip extraction (how do you get the output into the progress bar)? I'm thinking of using ISDone.

I'm using 7zip for the extraction, and some custom code to control the progress bars.
The top progress bar is just subtracting how many items have been extracted from the total amount of downloaded components.
The bottom bar is a marquee progress bar, so it doesn't actually show any progress. It just shows that something is happening. I couldn't find a reliable way to get a percentage of how many files were extracted from the zip, so I opted for this instead. Seems good enough to me, at least.

Also, do you know of any good methods of redirecting the console output of a command-line application to the progress bar? I need to filter the output of the application to only include the lines referencing the file currently being extracted and put that in the status message

That's tricky. I only know about the hacky method of starting the command-line application through cmd.exe, redirecting its output to a log.txt and then filling a form with the contents of that log file in the UI somewhere. I'm sure you've read about this somewhere as well.

Which plugin is that? Those added details (file, speed, status, etc) would be useful to include.

That's IDP. The same one mentioned a couple of posts above.
I had to make some changes to make it work with Inno's new "resizable" interface, but everything else is untouched.

And your solution for ZIP extraction: Does it "lock up" the installer as it performs the extraction process?

Actually, it doesn't. Some people on stackoverflow had the same issue, so I just borrowed their solution.

Here's a quick video of how exactly it looks during the extraction process:

2021-07-08.19-12-32.mp4

Thanks for sharing details for all of this and helping us along!

No problem! I'd love to help you guys however I can.

@hgdagon
Copy link

hgdagon commented Jul 8, 2021

The bottom bar is a marquee progress bar, so it doesn't actually show any progress.

Ah, OK then, I'll keep trying out plugins in that case. There's quite a few zip extraction plugins, at least one of them should be able to show progress.

I only know about the hacky method of starting the command-line application through cmd.exe, redirecting its output to a log.txt and then filling a form with the contents of that log file in the UI somewhere.

Yeah... Can't find anything else myself. I guess I'll look into that one. Although, I'm sure there should a Shell object (or whatever it's called) that should achieve what we want.

That's IDP.

Since they've added native download support, JRSoftware no longer recommends using either of the download plugins. I'm sure they'll keep working on it. In fact, hash verification was added in the latest update, so it'll only get better.

I noticed your installer has an additional copy step after extracting the archives, and I'm assuming you're copying from "SILENT HILL 2" to the parent directory. Can you share how you show progress for that one?

@nipkownix
Copy link
Contributor

nipkownix commented Jul 11, 2021

Since they've added native download support, JRSoftware no longer recommends using either of the download plugins. I'm sure they'll keep working on it. In fact, hash verification was added in the latest update, so it'll only get better.

Yeah, their native solution is nice to have, but IDP is still more feature complete for my taste.

I noticed your installer has an additional copy step after extracting the archives, and I'm assuming you're copying from "SILENT HILL 2" to the parent directory. Can you share how you show progress for that one?

The page after extracting files is the usual wpInstalling page, controlled by Inno itself. That progress bar is Inno copying files from the [Files] section to the {app} dir.

Also, I managed to get 7zip's stdout showing in the extraction page using this helper, and it looks quite nice.

image

image

Maybe you should give that helper a look.

@nipkownix
Copy link
Contributor

Managed to hook up the bottom progress bar to the % output given by 7zip. Now both progress bars are fully functional.

image

I gotta say, I didn't think it was possible without writing a new Inno plugin to handle 7zip specifically.

@Polymega
Copy link
Collaborator

Very nice.
I'm not a programmer so it's not really my place to ask, but would it be beneficial for you two to collaborate on this via a repo or the like?

@hgdagon
Copy link

hgdagon commented Jul 12, 2021

Maybe you should give that helper a look.

I did, but unfortunately I don't know the first thing about C/C++...

Managed to hook up the bottom progress bar to the % output given by 7zip. Now both progress bars are fully functional.

Awesome! That's actually the first thing that came to mind. Just grab percentage, and the current filename being extracted, instead of showing the full output, 'cause I think that's useless info for the user.

I gotta say, I didn't think it was possible without writing a new Inno plugin to handle 7zip specifically.

A few, actually, exist. I've been messing with ISDone. But they all do 7z only, not zip. This method is leagues better, so we don't need to request package format change. @Polymega I will probably need to ask to eliminate the extra subdirectory.

would it be beneficial for you two to collaborate on this via a repo or the like?

I already created a private repo for the installer, haven't uploaded any code there yet, was waiting for @elishacloud . But, yes this is a good idea.

@brunibunny In the meantime, can you share your code? If only just the part that operates this page. I might actually need to ask you to edit a different C-code application/dll, if that's something you'd be willing to do.

@Polymega
Copy link
Collaborator

@Polymega I will probably need to ask to eliminate the extra subdirectory.

Sure thing. @brunibunny, if you want, send me an email and I can give you FTP credentials for a sandbox server, so you can test things out with hgdagon. The thought with the sandbox is to make dummy packages so you can test with smaller package sizes and such.

@nipkownix
Copy link
Contributor

nipkownix commented Jul 13, 2021

Awesome! That's actually the first thing that came to mind. Just grab percentage, and the current filename being extracted, instead of showing the full output, 'cause I think that's useless info for the user.

I actually like the full output, but that's just a silly preference of mine :p

A few, actually, exist. I've been messing with ISDone. But they all do 7z only, not zip. This method is leagues better, so we don't need to request package format change. @Polymega I will probably need to ask to eliminate the extra subdirectory.

I had a look at ISDone, but its... "precedence" didn't look very trustworthy. There is no source code available and it was apparently created by some russians to be used in unpacking cracked games, from what I could gather. I was hoping someone else would have created something more open-source-friendly and I did find ArchMan, but it's nowhere near feature complete and also quite old. Not to mention I would have to actually implement a decompression function, since it can only compress files as-is.

About that subdirectory, are you talking about the root "SILENT HILL 2" dir that's present in the current .zip files? I've had problems with that too. 7za.exe just can't handle ignoring that dir but keeping all its subdirs in place. My workaround was to extract the downloaded files to {tmp} and have Inno itself copy them to the correct destination. That adds an unnecessary copy stage that can be avoided if we extract it directly into the game's folder to begin with. Apparently you've already been talking to @Polymega about this, so that's nice.

I already created a private repo for the installer, haven't uploaded any code there yet, was waiting for @elishacloud . But, yes this is a good idea.
@brunibunny In the meantime, can you share your code? If only just the part that operates this page. I might actually need to ask you to edit a different C-code application/dll, if that's something you'd be willing to do.

I went ahead and published the entire code here: https://github.com/brunibunny/SH2EE-web-installer
You're probably better off having access to the whole thing, instead of me just posting snippets here and trying to explain how they should work. Also, I wanted to archive it for future reference, so it's a win-win.

If you want to talk about something in private, such as direct collaboration with your repo, you can contact me on Discord: nipkow#0003. But it does look like you have almost everything under control :p

Sure thing. @brunibunny, if you want, send me an email and I can give you FTP credentials for a sandbox server, so you can test things out with hgdagon. The thought with the sandbox is to make dummy packages so you can test with smaller package sizes and such.

Sounds good. I'll contact you shortly.

@YouKnow-sys
Copy link

Hi, how this project going?
I also would love to work on this, but firstly I need to know the states of current project.
I can create the installer either with c++ (qt) or inno setup or even batch and PowerShell scripts, its just matter of features that you need for installer

@Polymega
Copy link
Collaborator

Polymega commented Oct 2, 2021

Hi there. Thank you for offering to help! @nipkownix has taken leadership of this task and has since created an installer that accomplishes all of our needs. The tool is practically finalized and is awaiting project integration at this time.

But thank you again for reaching out to us and offering your assistance!

@Polymega
Copy link
Collaborator

@nipkownix you are a beautiful, beautiful person. I can't wait until we release the next update to share your wonderful installer with everyone! I'll close this ticket out since everything is squared away now. THANK YOU!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants