[TOOL] The Sims 4 Portable - No elevated privileges needed for Reloaded 32-bit

View previous topic View next topic Go down

[TOOL] The Sims 4 Portable - No elevated privileges needed for Reloaded 32-bit

Post by Gigowatt221 on Sat 18 Mar 2017, 12:13

The Sims 4 Portable script aim is to create temporary registry keys, redirect "Documents\Electronic Arts\" to a "Saves" subfolder into the same place of the script, then it starts the game and when it's closed, clean up registry keys and saves redirections. So a permanent installation of The Sims 4 is safely protected and script won't broke a "normal" The Sims 4 installation.

What script does:
- Auto detects OS language, changes registry keys and even "RldOrigin.ini" file to adapt language of The Sims 4;
- Auto detects OS architecture (x86 or x64);
- Detects if "Origin" folder exists in the same folder and create temporary registry keys and folder redirections for a portable Origin too;
- Auto closes Origin before the game starts and closes;
- Auto hide itself if nircmd is installed (or add "nircmd.exe" where the script is). Google NirCMD to know what it is and download it (not required);
- Run 32-bit version of the game on a 64-bit Windows doesn't need elevated privileges anymore;
- Don't need elevated privileges for legit game or Origin, for any 32 or 64-bit version.

How to use:
Just run the script with elevated privileges (administrator) or create a shortcut and tick "administrator privileges" in "Compatibility". If the script is started in the "installation" folder of The Sims 4, the game will start immediately. If not, then the configuration file of the script is opened for a manual edit and user has to add the path of The Sims 4 folder (relative path is allowed).

How can I run 32-bit The Sims 4 without elevated privileges on a 64-bit Windows ?
Edit the INI configuration file and write this to force running 32-bit version:
Code:
GameBin=Game\Bin\TS4.exe
If you use a legit game, any 32 or 64-bit version can be run without elevated privileges.

Where are my saves?
Into the "Saves" folder where the script is. Same for Origin Portable data (and some registry backup).
Variable SavesPath can be set to change Saves folder.

How can I make Origin portable?
Copy your "Origin" folder where the script is.
Variable OriginPath can be set to change Origin folder.

How can I run Origin instead of game?
Set variable GameBin=Origin in the configuration file.
Origin doesn't need elevated privileges excepted for downloading if the installation folder need these privileges.


Script (open Notepad or Notepad++, copy-paste following code and then save it as "The Sims 4 Portable.cmd" file):

Code:
@echo off

if "%ScriptTitle%"=="" set ScriptTitle=The Sims 4 Portable
title %ScriptTitle% - Initializing...
if "%SfxString1%"=="" nircmd win hide ititle "%ScriptTitle% - Initializing..."

set AnotherInstanceRunning=0
for /f "skip=1 tokens=2,9 delims=," %%a in ('tasklist /v /fi "imagename eq cmd.exe" /fo csv') do (
   echo %%~b| find /i "%ScriptTitle% - Initializing..." >nul 2>&1&& set ScriptPID=%%~a
   echo %%~b| find /i "%ScriptTitle% - Running..." >nul 2>&1&& if not "%%~a"=="%ScriptPID%" set AnotherInstanceRunning=1
)

if /i not "%CD%"=="%windir%\System32" (
   set CurrentDir=%CD%
) else (
   set CurrentDir=%~dp0
)
if "%CurrentDir:~-1%"=="\" set CurrentDir=%CurrentDir:~0,-1%

if "%System32Dir%"=="" set System32Dir=%windir%\System32

for %%a in (%*) do if /i "%%~xa"==".ini" set ConfigurationFile=%%~a
if "%ConfigurationFile%"=="" set ConfigurationFile=%CurrentDir%\%~n0.ini
if not exist "%ConfigurationFile%" (
   if "%Language%"=="" for /f "tokens=3 delims= " %%a in ('%System32Dir%\reg.exe query "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Nls\Language" /v Installlanguage') do (
   if [%%a] equ [0405] set Language=cs_CZ
   if [%%a] equ [0406] set Language=da_DK
   if [%%a] equ [0407] set Language=de_DE
   if [%%a] equ [0409] set Language=en_US
   if [%%a] equ [0C0A] set Language=es_ES
   if [%%a] equ [040B] set Language=fi_FI
   if [%%a] equ [040C] set Language=fr_FR
   if [%%a] equ [0410] set Language=it_IT
   if [%%a] equ [0411] set Language=ja_JP
   if [%%a] equ [0412] set Language=ko_KR
   if [%%a] equ [0413] set Language=nl_NL
   if [%%a] equ [0414] set Language=no_NO
   if [%%a] equ [0415] set Language=pl_PL
   if [%%a] equ [0416] set Language=pt_BR
   if [%%a] equ [0419] set Language=ru_RU
   if [%%a] equ [041D] set Language=sv_SE
   if [%%a] equ [0404] set Language=zh_TW
   )
)
chcp 1252>nul
if exist "%ConfigurationFile%" (
   for /f "usebackq eol=; tokens=1,2 delims==" %%a in ("%ConfigurationFile%") do (
      if not "%%~b"=="" if exist "%CurrentDir%\%%~b" (
         call set %%~a=%CurrentDir%\%%~b
      ) else (
         call set %%~a=%%~b
      )
   )
) else (
   echo GameInstallationPath=> "%ConfigurationFile%"
   echo Language=%Language%>> "%ConfigurationFile%"
   echo SavesPath=%SavesPath%>> "%ConfigurationFile%"
   echo OriginPath=%OriginPath%>> "%ConfigurationFile%"
   echo ;Optional, for power users. Write GameBin=Game\Bin\TS4.exe if you need to run the Reloaded game without elevated privileges or write Origin to run Origin:>> "%ConfigurationFile%"
   echo GameBin=>> "%ConfigurationFile%"
   echo New INI file created: "%ConfigurationFile%"
)
chcp 850>nul

if "%GameInstallationPath%"=="" set GameInstallationPath=%CurrentDir%
if "%SavesPath%"=="" set SavesPath=%CurrentDir%\Saves
if "%OriginPath%"=="" set OriginPath=%CurrentDir%\Origin
if "%GameBin%"=="%OriginPath%" set GameBin=%OriginPath%\Origin.exe
if "%GameBin%"=="Origin" set GameBin=%OriginPath%\Origin.exe

"%System32Dir%\reg.exe" query "HKEY_LOCAL_MACHINE\Hardware\Description\System\CentralProcessor\0"| find /i "x86">nul&& (
   if "%WOW6432Node%"=="" set WOW6432Node=
   if "%GameBin%"=="" set GameBin=%GameInstallationPath%\Game\Bin\TS4.exe
)|| (
   if "%WOW6432Node%"=="" set WOW6432Node=\WOW6432Node
   if "%GameBin%"=="" set GameBin=%GameInstallationPath%\Game\Bin\TS4_x64.exe
)
"%System32Dir%\reg.exe" query HKEY_USERS\S-1-5-19 >nul 2>&1&& (
   if "%IsAdmin%"=="" set IsAdmin=1
   if "%mklink%"=="" set mklink=d
)|| (
   set __COMPAT_LAYER=RUNASINVOKER
   if "%IsAdmin%"=="" set IsAdmin=0
   if "%mklink%"=="" set mklink=j
   if "%WOW6432Node%"=="\WOW6432Node" (
      set System32Dir=%windir%\SysWOW64
      echo %GameBin%| find /i "x64"> nul&& set reg64=/reg:64
   )
   if exist "%GameBin%_No_Admin.exe" set GameBin=%GameBin:.exe=_No_Admin.exe%
)

for /f "skip=2 tokens=3*" %%a in ('%System32Dir%\reg.exe query "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" /v "Personal"') do set DocumentsDir=%%a

echo ConfigurationFile: %ConfigurationFile%
echo GameInstallationPath: %GameInstallationPath%
echo Language: %Language%
echo SavesPath: %SavesPath%
echo OriginPath: %OriginPath%
echo GameBin: %GameBin%
echo Variables loaded
echo.

goto :ScriptBeginning

:REGBackup
(
   "%System32Dir%\reg.exe" query "HKEY_LOCAL_MACHINE\SOFTWARE\Maxis\The Sims 4" /v "IsPortable" %reg64%&& "%System32Dir%\reg.exe" delete "HKEY_LOCAL_MACHINE\SOFTWARE\Maxis\The Sims 4" /f %reg64%
   "%System32Dir%\reg.exe" query "HKEY_LOCAL_MACHINE\SOFTWARE\Maxis\The Sims 4.PortableBackup" /f * %reg64%|| "%System32Dir%\reg.exe" copy "HKEY_LOCAL_MACHINE\SOFTWARE\Maxis\The Sims 4" "HKEY_LOCAL_MACHINE\SOFTWARE\Maxis\The Sims 4.PortableBackup" /s /f %reg64%
   "%System32Dir%\reg.exe" delete "HKEY_LOCAL_MACHINE\SOFTWARE\Maxis\The Sims 4" /f %reg64%
) >nul 2>&1
if exist "%OriginPath%" (
   "%System32Dir%\reg.exe" query "HKEY_LOCAL_MACHINE\SOFTWARE\Electronic Arts" /v "IsPortable" /reg:32&& "%System32Dir%\reg.exe" delete "HKEY_LOCAL_MACHINE\SOFTWARE\Electronic Arts" /f /reg:32
   "%System32Dir%\reg.exe" query "HKEY_LOCAL_MACHINE\SOFTWARE\Electronic Arts.PortableBackup" /f * /reg:32|| "%System32Dir%\reg.exe" copy "HKEY_LOCAL_MACHINE\SOFTWARE\Electronic Arts" "HKEY_LOCAL_MACHINE\SOFTWARE\Electronic Arts.PortableBackup" /s /f /reg:32
   "%System32Dir%\reg.exe" delete "HKEY_LOCAL_MACHINE\SOFTWARE\Electronic Arts" /f /reg:32
   "%System32Dir%\reg.exe" query "HKEY_LOCAL_MACHINE\SOFTWARE\Origin" /v "IsPortable" /reg:32&& "%System32Dir%\reg.exe" delete "HKEY_LOCAL_MACHINE\SOFTWARE\Origin" /f /reg:32
   "%System32Dir%\reg.exe" query "HKEY_LOCAL_MACHINE\SOFTWARE\Origin.PortableBackup" /f * /reg:32|| "%System32Dir%\reg.exe" copy "HKEY_LOCAL_MACHINE\SOFTWARE\Origin" "HKEY_LOCAL_MACHINE\SOFTWARE\Origin.PortableBackup" /s /f /reg:32
   "%System32Dir%\reg.exe" delete "HKEY_LOCAL_MACHINE\SOFTWARE\Origin" /f /reg:32
   "%System32Dir%\reg.exe" query "HKEY_LOCAL_MACHINE\SOFTWARE\Origin Games" /v "IsPortable" /reg:32&& "%System32Dir%\reg.exe" delete "HKEY_LOCAL_MACHINE\SOFTWARE\Origin Games" /f /reg:32
   "%System32Dir%\reg.exe" query "HKEY_LOCAL_MACHINE\SOFTWARE\Origin Games.PortableBackup" /f * /reg:32|| "%System32Dir%\reg.exe" copy "HKEY_LOCAL_MACHINE\SOFTWARE\Origin Games" "HKEY_LOCAL_MACHINE\SOFTWARE\Origin Games.PortableBackup" /s /f /reg:32
   "%System32Dir%\reg.exe" delete "HKEY_LOCAL_MACHINE\SOFTWARE\Origin Games" /f /reg:32
) >nul 2>&1
exit /b

:DIRBackup
rmdir /q "%DocumentsDir%\Electronic Arts"
ren "%DocumentsDir%\Electronic Arts" "Electronic Arts.PortableBackup"
if exist "%OriginPath%" (
   rmdir /q "%APPDATA%\Origin"
   ren "%APPDATA%\Origin" "Origin.PortableBackup"
   rmdir /q "%LOCALAPPDATA%\Origin"
   ren "%LOCALAPPDATA%\Origin" "Origin.PortableBackup"
)
exit /b

:RldOriginBackup
if not exist "%GameInstallationPath%\Game\Bin\RldOrigin.PortableBackup.ini" (
   ren "%GameInstallationPath%\Game\Bin\RldOrigin.ini" "RldOrigin.PortableBackup.ini"
) else (
   del /f "%GameInstallationPath%\Game\Bin\RldOrigin.ini"
)
exit /b

:REGRestoration
(
   "%System32Dir%\reg.exe" export "HKEY_LOCAL_MACHINE\SOFTWARE\Maxis\The Sims 4" "%SavesPath%\Reg\The Sims 4.Portable.reg" /y %reg64%
   "%System32Dir%\reg.exe" delete "HKEY_LOCAL_MACHINE\SOFTWARE\Maxis\The Sims 4" /f %reg64%
   "%System32Dir%\reg.exe" copy "HKEY_LOCAL_MACHINE\SOFTWARE\Maxis\The Sims 4.PortableBackup" "HKEY_LOCAL_MACHINE\SOFTWARE\Maxis\The Sims 4" /s /f %reg64%
   "%System32Dir%\reg.exe" delete "HKEY_LOCAL_MACHINE\SOFTWARE\Maxis\The Sims 4.PortableBackup" /f %reg64%
   "%System32Dir%\reg.exe" query "HKEY_LOCAL_MACHINE\SOFTWARE\Maxis" /f * %reg64%|| "%System32Dir%\reg.exe" delete "HKEY_LOCAL_MACHINE\SOFTWARE\Maxis" /f %reg64%
) >nul 2>&1
if exist "%OriginPath%" (
   "%System32Dir%\reg.exe" export "HKEY_LOCAL_MACHINE\SOFTWARE\Electronic Arts" "%SavesPath%\Reg\Electronic Arts.Portable.reg" /y /reg:32
   "%System32Dir%\reg.exe" delete "HKEY_LOCAL_MACHINE\SOFTWARE\Electronic Arts" /f /reg:32
   "%System32Dir%\reg.exe" copy "HKEY_LOCAL_MACHINE\SOFTWARE\Electronic Arts.PortableBackup" "HKEY_LOCAL_MACHINE\SOFTWARE\Electronic Arts" /s /f /reg:32
   "%System32Dir%\reg.exe" delete "HKEY_LOCAL_MACHINE\SOFTWARE\Electronic Arts.PortableBackup" /f /reg:32
   "%System32Dir%\reg.exe" query "HKEY_LOCAL_MACHINE\SOFTWARE\Electronic Arts" /f * /reg:32|| "%System32Dir%\reg.exe" delete "HKEY_LOCAL_MACHINE\SOFTWARE\Electronic Arts" /f /reg:32
   "%System32Dir%\reg.exe" export "HKEY_LOCAL_MACHINE\SOFTWARE\Origin" "%SavesPath%\Reg\Origin.Portable.reg" /y /reg:32
   "%System32Dir%\reg.exe" delete "HKEY_LOCAL_MACHINE\SOFTWARE\Origin" /f /reg:32
   "%System32Dir%\reg.exe" copy "HKEY_LOCAL_MACHINE\SOFTWARE\Origin.PortableBackup" "HKEY_LOCAL_MACHINE\SOFTWARE\Origin" /s /f /reg:32
   "%System32Dir%\reg.exe" delete "HKEY_LOCAL_MACHINE\SOFTWARE\Origin.PortableBackup" /f /reg:32
   "%System32Dir%\reg.exe" query "HKEY_LOCAL_MACHINE\SOFTWARE\Origin" /f * /reg:32|| "%System32Dir%\reg.exe" delete "HKEY_LOCAL_MACHINE\SOFTWARE\Origin" /f /reg:32
   "%System32Dir%\reg.exe" export "HKEY_LOCAL_MACHINE\SOFTWARE\Origin Games" "%SavesPath%\Reg\Origin Games.Portable.reg" /y /reg:32
   "%System32Dir%\reg.exe" delete "HKEY_LOCAL_MACHINE\SOFTWARE\Origin Games" /f /reg:32
   "%System32Dir%\reg.exe" copy "HKEY_LOCAL_MACHINE\SOFTWARE\Origin Games.PortableBackup" "HKEY_LOCAL_MACHINE\SOFTWARE\Origin Games" /s /f /reg:32
   "%System32Dir%\reg.exe" delete "HKEY_LOCAL_MACHINE\SOFTWARE\Origin Games.PortableBackup" /f /reg:32
   "%System32Dir%\reg.exe" query "HKEY_LOCAL_MACHINE\SOFTWARE\Origin Games" /f * /reg:32|| "%System32Dir%\reg.exe" delete "HKEY_LOCAL_MACHINE\SOFTWARE\Origin Games" /f /reg:32
) >nul 2>&1
exit /b

:DIRRestoration
rmdir /q "%DocumentsDir%\Electronic Arts"
ren "%DocumentsDir%\Electronic Arts.PortableBackup" "Electronic Arts"
if exist "%OriginPath%" (
   rmdir /q "%APPDATA%\Origin"
   ren "%APPDATA%\Origin.PortableBackup" "Origin"
   rmdir /q "%LOCALAPPDATA%\Origin"
   ren "%LOCALAPPDATA%\Origin.PortableBackup" "Origin"
)
exit /b

:RldOriginRestoration
if exist "%GameInstallationPath%\Game\Bin\RldOrigin.PortableBackup.ini" (
   del /f "%GameInstallationPath%\Game\Bin\RldOrigin.ini"
   ren "%GameInstallationPath%\Game\Bin\RldOrigin.PortableBackup.ini" "RldOrigin.ini"
)
exit /b

:ScriptBeginning
title %ScriptTitle% - Running...
if "%AnotherInstanceRunning%"=="1" goto :AnotherInstanceDetected1

call :REGBackup
(
   "%System32Dir%\reg.exe" import "%SavesPath%\Reg\The Sims 4.Portable.reg" %reg64%
   "%System32Dir%\reg.exe" add "HKEY_LOCAL_MACHINE\SOFTWARE\Maxis\The Sims 4" /f /v "IsPortable" /d "1" %reg64%
   "%System32Dir%\reg.exe" add "HKEY_LOCAL_MACHINE\SOFTWARE\Maxis\The Sims 4" /f /v "DisplayName" /d "The Sims 4 Portable" %reg64%
   "%System32Dir%\reg.exe" add "HKEY_LOCAL_MACHINE\SOFTWARE\Maxis\The Sims 4" /f /v "GDFBinary" /d "%GameInstallationPath%\__Installer\GDFBinary_%Language%.dll" %reg64%
   "%System32Dir%\reg.exe" add "HKEY_LOCAL_MACHINE\SOFTWARE\Maxis\The Sims 4" /f /v "GDFBinary64" /d "%GameInstallationPath%\__Installer\GDFBinary_%Language%_64.dll" %reg64%
   "%System32Dir%\reg.exe" add "HKEY_LOCAL_MACHINE\SOFTWARE\Maxis\The Sims 4" /f /v "Install Dir" /d "%GameInstallationPath%" %reg64%
   "%System32Dir%\reg.exe" add "HKEY_LOCAL_MACHINE\SOFTWARE\Maxis\The Sims 4" /f /v "Locale" /d "%Language%" %reg64%
   "%System32Dir%\reg.exe" add "HKEY_LOCAL_MACHINE\SOFTWARE\Maxis\The Sims 4\InstallOptSelect" /f /ve /d "1" %reg64%
   if not exist "%SavesPath%\Reg\The Sims 4.Portable.reg" (
      "%System32Dir%\reg.exe" add "HKEY_LOCAL_MACHINE\SOFTWARE\Maxis\The Sims 4" /f /v "Product GUID" /d "{48EBEBBF-B9F8-4520-A3CF-89A730721917}" %reg64%
      "%System32Dir%\reg.exe" add "HKEY_LOCAL_MACHINE\SOFTWARE\Maxis\The Sims 4" /f /v "GameExplorer" /d "{2188209F-D146-42AE-B76C-816118F43C9F}" %reg64%
   )
) >nul 2>&1
if exist "%OriginPath%" (
   "%System32Dir%\reg.exe" import "%SavesPath%\Reg\Electronic Arts.Portable.reg" /reg:32
   "%System32Dir%\reg.exe" add "HKEY_LOCAL_MACHINE\SOFTWARE\Electronic Arts" /f /v "IsPortable" /d "1" /reg:32
   "%System32Dir%\reg.exe" add "HKEY_LOCAL_MACHINE\SOFTWARE\Electronic Arts\EA Core" /f /v "ClientAccessDLLPath" /d "%OriginPath%\legacyPM\CmdPortalClient.dll" /reg:32
   "%System32Dir%\reg.exe" add "HKEY_LOCAL_MACHINE\SOFTWARE\Electronic Arts\EA Core" /f /v "ClientPath" /d "%OriginPath%\legacyPM\OriginLegacyCLI.exe" /reg:32
   "%System32Dir%\reg.exe" add "HKEY_LOCAL_MACHINE\SOFTWARE\Electronic Arts\EA Core" /f /v "EADM6InstallDir" /d "%OriginPath%" /reg:32
   "%System32Dir%\reg.exe" add "HKEY_LOCAL_MACHINE\SOFTWARE\Electronic Arts\EADM" /f /v "ClientPath" /d "%OriginPath%\Origin.exe" /reg:32
   if not exist "%SavesPath%\Reg\Electronic Arts.Portable.reg" (
      "%System32Dir%\reg.exe" add "HKEY_LOCAL_MACHINE\SOFTWARE\Electronic Arts\EA Core" /f /v "ClientVersion" /d "99.9.9.9" /reg:32
      "%System32Dir%\reg.exe" add "HKEY_LOCAL_MACHINE\SOFTWARE\Electronic Arts\EA Core" /f /v "EADM6Version" /d "99.9.9.9" /reg:32
      "%System32Dir%\reg.exe" add "HKEY_LOCAL_MACHINE\SOFTWARE\Electronic Arts\EADM" /f /v "ClientVersion" /d "99.9.9.99999" /reg:32
   )
   "%System32Dir%\reg.exe" import "%SavesPath%\Reg\Origin.Portable.reg" /reg:32
   "%System32Dir%\reg.exe" add "HKEY_LOCAL_MACHINE\SOFTWARE\Origin" /f /v "IsPortable" /d "1" /reg:32
   "%System32Dir%\reg.exe" add "HKEY_LOCAL_MACHINE\SOFTWARE\Origin" /f /v "ClientPath" /d "%OriginPath%\Origin.exe" /reg:32
   if not exist "%SavesPath%\Reg\Origin.Portable.reg" (
      "%System32Dir%\reg.exe" add "HKEY_LOCAL_MACHINE\SOFTWARE\Origin" /f /v "AutopatchGlobal" /d "false" /reg:32
      "%System32Dir%\reg.exe" add "HKEY_LOCAL_MACHINE\SOFTWARE\Origin" /f /v "Autoupdate" /d "false" /reg:32
      "%System32Dir%\reg.exe" add "HKEY_LOCAL_MACHINE\SOFTWARE\Origin" /f /v "ClientVersion" /d "99.9.9.99999" /reg:32
      "%System32Dir%\reg.exe" add "HKEY_LOCAL_MACHINE\SOFTWARE\Origin" /f /v "InstallSuccesfull" /d "true" /reg:32
      "%System32Dir%\reg.exe" add "HKEY_LOCAL_MACHINE\SOFTWARE\Origin" /f /v "IsBeta" /d "false" /reg:32
      "%System32Dir%\reg.exe" add "HKEY_LOCAL_MACHINE\SOFTWARE\Origin" /f /v "TelemOO" /d "false" /reg:32
   )
   "%System32Dir%\reg.exe" import "%SavesPath%\Reg\Origin Games.Portable.reg" /reg:32
) >nul 2>&1

call :DIRBackup
md "%SavesPath%\Reg"
mklink /%mklink% "%DocumentsDir%\Electronic Arts" "%SavesPath%"
if exist "%OriginPath%" (
   md "%SavesPath%\Origin\LocalAppData"
   mklink /%mklink% "%APPDATA%\Origin" "%SavesPath%\Origin"
   mklink /%mklink% "%LOCALAPPDATA%\Origin" "%SavesPath%\Origin\LocalAppData"
)

call :RldOriginBackup
if exist "%GameInstallationPath%\Game\Bin\RldOrigin.PortableBackup.ini" for /f "usebackq tokens=1,* delims==" %%a in ("%GameInstallationPath%\Game\Bin\RldOrigin.PortableBackup.ini") do if not "%%b"=="" (
   if /i not "%%a"=="Language" (
      echo %%a=%%b>> "%GameInstallationPath%\Game\Bin\RldOrigin.ini"
   ) else (
      echo %%a=%Language%>> "%GameInstallationPath%\Game\Bin\RldOrigin.ini"
   )
) else (
   echo %%a>> "%GameInstallationPath%\Game\Bin\RldOrigin.ini"
)

taskkill /im "Origin.exe" /t /f

:AnotherInstanceDetected1
if exist "%GameBin%" (
   start "" /wait "%GameBin%"
) else (
   start "" notepad "%ConfigurationFile%"
)

set AnotherInstanceRunning=0
for /f "skip=1 tokens=2,9 delims=," %%a in ('tasklist /v /fi "imagename eq cmd.exe" /fo csv') do (
   echo %%~b| find /i "%ScriptTitle% - Running..." >nul 2>&1&& if not "%%~a"=="%ScriptPID%" set AnotherInstanceRunning=1
)

if "%AnotherInstanceRunning%"=="1" goto :AnotherInstanceDetected2

taskkill /im "Origin.exe" /t /f
call :REGRestoration
call :DIRRestoration
call :RldOriginRestoration
:AnotherInstanceDetected2




Mod edit: moved to "The Sims 4 tips & tricks".  Smile

- The_gh0stm4n


Last edited by Gigowatt221 on Thu 23 Mar 2017, 16:07; edited 6 times in total
avatar
Gigowatt221
Posting Nerd
Posting Nerd

Windows version :
  • Windows 8

System architecture :
  • 32 bits (x86)
  • 64 bits (x64)

Posts : 20
Points : 1589
Reputation : 6
Join date : 2013-02-19

View user profile

Back to top Go down

Re: [TOOL] The Sims 4 Portable - No elevated privileges needed for Reloaded 32-bit

Post by Tarac on Sat 18 Mar 2017, 13:12

Maybe I've misunderstood the aim of the script, but the pirated version of the Sims 4 is already portable by nature.
Just copy your install-folder to an USB-stick or external drive and you can play the game on any, suitable, computer without installation or entries in the register.
avatar
Tarac
Quartermaster General
Honorary Team Member
Quartermaster General Honorary Team Member

Windows version :
  • Windows 8
  • Windows 7
  • Windows 10

System architecture :
  • 64 bits (x64)

Favourite games : Card games
Male Posts : 1386
Points : 2964
Reputation : 181
Join date : 2013-09-14
Age : 73
Location : The Netherlands

View user profile http://www.tarac.nl

Back to top Go down

Re: [TOOL] The Sims 4 Portable - No elevated privileges needed for Reloaded 32-bit

Post by Gigowatt221 on Sat 18 Mar 2017, 14:58

I do not considere the pirated version "portable" because of the need to manually copy saves. Plus, if I use Origin for the game, I also need to make Origin portable.
Actually I'm working on getting legit copy to verify somethings, such as running it without needing administrator privileges.

//EDIT


Update 2  Haters gonna hate
- New default configuration file:
Code:
GameInstallationPath=
Language=en_US
SavesPath=
OriginPath=
;Optional, for power users. Write GameBin=Game\Bin\TS4.exe if you need to run the Reloaded game without elevated privileges or write Origin to run Origin:
GameBin=
 *Language is adapted to your system language
- You can now change Saves and Origin folder pathes
- Origin registry modifications can now handle Origin Games (forgotten registry keys)
- You own registry modifications are now saved into "Saves\Reg"
- You can easily run Origin instead of game by setting GameBin=Origin
- You can run multiple instances of the script without messing with registry modifications or redirected links. The first instance makes modifications and the last restores all


Update 1 ºᴥº

- Changed variable TS4exe to GameBin (delete old configuration file or change it manually)
- You can properly change GameBin variable to run any program instead of TS4 (by default)
- Typo
- Some bugs with Origin path (variable)
- Forgotten to redirect Origin "LocalAppData" data
- Some bugs when running 32-bit version on 64-bit Windows
- 32-bit version running on 64-bit Windows doesn't need elevated privileges now! Fully portable for 32-bit The Sims 4  Don't play TS4 at school!
avatar
Gigowatt221
Posting Nerd
Posting Nerd

Windows version :
  • Windows 8

System architecture :
  • 32 bits (x86)
  • 64 bits (x64)

Posts : 20
Points : 1589
Reputation : 6
Join date : 2013-02-19

View user profile

Back to top Go down

View previous topic View next topic Back to top


Permissions in this forum:
You cannot reply to topics in this forum