Alex313031 / thorium-legacy

Repo for Windows XP/Vista & 7/8/8.1 Thorium Builds

Home Page:https://thorium.rocks/win7

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Thorium XP - Installer

Shine- opened this issue · comments

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.

@Shine- Done > 9a13203

And Done > d558e36

@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.

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.

@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.

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...