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

Thorium XP - Installer #73

Open
Shine- opened this issue Apr 19, 2024 · 5 comments
Open

Thorium XP - Installer #73

Shine- opened this issue Apr 19, 2024 · 5 comments

Comments

@Shine-
Copy link

Shine- commented Apr 19, 2024

System Details

  • OS: XP x86
  • Thorium Version: 122.0.6261.168 WINXP x32

Problem

First of all, Kudos for the XP build!

Just 2 minor issues that you might want to take care of in the next release:

  1. Better use %programfiles% instead of hardcoding C:\Program Files\Thorium into the installer. This will help users who have their Windows installed on a different drive than C: (this was still possible in XP), and it will help users who are running localized Windows versions. You will, however, then have to figure something out how to handle the .reg files (perhaps dynamically creating them from the installer .cmd?) and how to handle it if someone installs the x86 build on a 64-Bit OS (that one is easy: if %programfiles(x86)% exists, then you're on a 64-Bit OS).
  2. The installer .reg files are UNIX linefeeded (LF), instead of Windows (CRLF). Might not be a breaking issue, but XP Notepad didn't yet support LF, so it looks mangled when opening the .reg files in Notepad.
@Alex313031
Copy link
Owner

@Shine- Done > 9a13203

And Done > d558e36

@Shine- Shine- closed this as completed Apr 24, 2024
@Alex313031 Alex313031 reopened this Apr 29, 2024
@Alex313031
Copy link
Owner

@Shine- I still need to do the 32 bit on 64 bit program files fix. As far as the .reg files go, yeah IDK how to do that. May have to just tell users to edit them using find and replace before installation.

@Shine-
Copy link
Author

Shine- commented Apr 29, 2024

You could, for example, create the registry entries one by one using reg add, instead of importing the .reg file. Or create the .reg files dynamically, just like you're already creating the .vbs scripts.

And, of course, optionally still provide the pre-written .reg files for the users who prefer to not run the automatic installer.

@Alex313031
Copy link
Owner

@Shine- I am much more good at bash than batch lol. How would I have the script dynamically get the drive letter and apply it to the registry entries needed?

A really dirty approach would be to ship multiple versions of the .reg files, with different common drive letters like D: and E: in them lol.

@Shine-
Copy link
Author

Shine- commented May 14, 2024

Since Windows doesn't have a sed equivalent, it's a bit tricky.

See below for an example script that will read your predefined .reg files, replace C:\Program Files with the actual directory name from the current system, then create and import a temporary .reg file.
Note: This is for the 32 bit build - remove the if snippet with %programfiles(x86)% for the x64 build.

It would be much easier with VBS or PowerShell, but I wanted to keep this plain CMD.

@echo off
set "pf=%programfiles:\=\\%"
if "%programfiles(x86)%" neq "" (
  set "pf=%programfiles(x86):\=\\%"
)
echo Windows Registry Editor Version 5.00 > %temp%\thorium.reg
setlocal enabledelayedexpansion
for /f "skip=2 tokens=* delims= " %%n in (HKLM.reg HKCR.reg) do (
  set "line=%%n"
  set "line=!line:C:\\Program Files\\=%pf%\\!"
  if "!line:~0,1!"=="[" echo.
  echo !line!
) >> %temp%\thorium.reg
endlocal
start /wait regedit /s %temp%\thorium.reg
del %temp%\thorium.reg

Use with caution, might still contain bugs...

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