-
Notifications
You must be signed in to change notification settings - Fork 35
Expand file tree
/
Copy pathsetup_windows.bat
More file actions
576 lines (519 loc) · 19.6 KB
/
Copy pathsetup_windows.bat
File metadata and controls
576 lines (519 loc) · 19.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
REM Setup OptiScaler for your game
@echo off
cls
echo :::::::: ::::::::: ::::::::::: ::::::::::: :::::::: :::::::: ::: ::: :::::::::: :::::::::
echo :+: :+: :+: :+: :+: :+: :+: :+: :+: :+: :+: :+: :+: :+: :+: :+:
echo +:+ +:+ +:+ +:+ +:+ +:+ +:+ +:+ +:+ +:+ +:+ +:+ +:+ +:+
echo +#+ +:+ +#++:++#+ +#+ +#+ +#++:++#++ +#+ +#++:++#++: +#+ +#++:++# +#++:++#:
echo +#+ +#+ +#+ +#+ +#+ +#+ +#+ +#+ +#+ +#+ +#+ +#+ +#+
echo #+# #+# #+# #+# #+# #+# #+# #+# #+# #+# #+# #+# #+# #+# #+#
echo ######## ### ### ########### ######## ######## ### ### ########## ########## ### ###
echo.
echo Coping is strong with this one...
echo v3.0-pre1
echo.
del "!! README_EXTRACT ALL FILES TO GAME FOLDER !!.txt" 2>nul
setlocal enabledelayedexpansion
if exist OptiScaler.sln (
echo Detected OptiScaler.sln or .git files^^!
echo.
echo If .sln or .git files are in the folder, congratz, you have the source code.
echo Now please try properly downloading OptiScaler.
echo.
echo Hint - use the Releases page on GitHub, or RTFM :^)
echo.
echo.
echo P.S. If you somehow have both the OptiScaler.dll and .sln file, then be nice, just delete the .sln file, re-run the BAT setup and hope for the best.
echo.
goto end
)
if not exist OptiScaler.dll (
echo OptiScaler "OptiScaler.dll" file is not found^^!
echo Detected a folder permissions issue most likely. Might have more luck running the BAT as admin.
echo.
echo OR
echo.
echo If "OptiScaler.dll" exists, please manually rename to a supported filename ^(e.g. dxgi/winmm.dll^) and you are done^^!
echo No need to run the setup BAT again after renaming.
echo.
echo.
goto end
)
REM Check if old pre-0.9 additional files exist, along with an existing Opti installation
set "OLD_FILES_FOUND=0"
set "OPTI_DLL_LIST="
if exist nvapi64.dll set "OLD_FILES_FOUND=1"
if exist nvngx.dll set "OLD_FILES_FOUND=1"
if exist OptiScaler.asi set "OLD_FILES_FOUND=1"
if exist "Remove OptiScaler.bat" set "OLD_FILES_FOUND=1"
if exist "Remove_OptiScaler.bat" set "OLD_FILES_FOUND=1"
for %%F in (dxgi.dll winmm.dll d3d12.dll dbghelp.dll version.dll wininet.dll winhttp.dll) do (
if exist "%%F" (
set "origname="
for /f "tokens=*" %%P in ('powershell -NoProfile -Command "(Get-Item '%%F').VersionInfo.OriginalFilename"') do (
set "origname=%%P"
)
if /i "!origname!"=="OptiScaler.dll" (
set "OLD_FILES_FOUND=1"
set "OPTI_DLL_LIST=!OPTI_DLL_LIST! %%F"
)
)
)
if "!OLD_FILES_FOUND!"=="1" (
echo WARNING: Possible old OptiScaler file^(s^) detected^^!
if exist nvapi64.dll echo - nvapi64.dll
if exist nvngx.dll echo - nvngx.dll
if exist OptiScaler.asi echo - OptiScaler.asi
if exist "Remove OptiScaler.bat" echo - Remove OptiScaler.bat
if exist "Remove_OptiScaler.bat" echo - Remove_OptiScaler.bat
for %%F in (!OPTI_DLL_LIST!) do echo - %%F ^(original filename: OptiScaler.dll^)
echo.
echo These files may conflict with the current version of OptiScaler.
echo It is recommended to delete them.
echo.
echo Do you want to delete these files?
echo.
echo [1] Yes
echo [2] No
echo.
set /p "USER_CHOICE=Waiting - "
echo.
if /i "!USER_CHOICE!"=="1" (
if exist nvapi64.dll (
del nvapi64.dll
echo Deleted nvapi64.dll
)
if exist nvngx.dll (
del nvngx.dll
echo Deleted nvngx.dll
)
if exist OptiScaler.asi (
del OptiScaler.asi
echo Deleted OptiScaler.asi
)
if exist "Remove OptiScaler.bat" (
del "Remove OptiScaler.bat"
echo Deleted Remove OptiScaler.bat
)
if exist "Remove_OptiScaler.bat" (
del "Remove_OptiScaler.bat"
echo Deleted Remove_OptiScaler.bat
)
for %%F in (!OPTI_DLL_LIST!) do (
del "%%F"
echo Deleted %%F
)
echo Done^^!
) else (
echo Skipping deletion. Note that these files may cause issues.
)
echo.
)
REM Set paths based on current directory
set "optiScalerFile=.\OptiScaler.dll"
set setupSuccess=false
REM Check if the Engine folder exists
if exist ".\Engine" (
echo Found Engine folder. If this is an Unreal Engine game, then please extract Optiscaler to #CODENAME#\Binaries\Win64
echo Do not extract to the Engine folder^^!
echo.
echo Example - \Jedi Survivor\SwGame\Binaries\Win64, \Witchfire\Witchfire\Binaries\Win64
echo.
echo Continue installation to current folder?
echo.
echo [1] Yes
echo [2] No
echo.
set /p continueChoice="Waiting - "
set continueChoice=!continueChoice: =!
if "!continueChoice!"=="1" (
goto selectFilename
)
goto end
)
REM Prompt user to select a filename for OptiScaler
:selectFilename
echo.
echo Choose a filename for OptiScaler (default is dxgi.dll, most compatible):
echo (For Vulkan, use winmm.dll. For XGP/MS Store, winmm/version.dll may be better)
echo.
echo [1] dxgi.dll
echo [2] winmm.dll
echo [3] version.dll
echo [4] dbghelp.dll
echo [5] d3d12.dll
echo [6] wininet.dll
echo [7] winhttp.dll
echo [8] OptiScaler.asi
echo.
set /p filenameChoice="Enter 1-8 (or press Enter for default): "
if "%filenameChoice%"=="" (
set selectedFilename="dxgi.dll"
) else if "%filenameChoice%"=="1" (
set selectedFilename="dxgi.dll"
) else if "%filenameChoice%"=="2" (
set selectedFilename="winmm.dll"
) else if "%filenameChoice%"=="3" (
set selectedFilename="version.dll"
) else if "%filenameChoice%"=="4" (
set selectedFilename="dbghelp.dll"
) else if "%filenameChoice%"=="5" (
set selectedFilename="d3d12.dll"
) else if "%filenameChoice%"=="6" (
set selectedFilename="wininet.dll"
) else if "%filenameChoice%"=="7" (
set selectedFilename="winhttp.dll"
) else if "%filenameChoice%"=="8" (
set selectedFilename="OptiScaler.asi"
) else (
echo Invalid choice. Please select a valid option.
echo.
goto selectFilename
)
if exist %selectedFilename% (
echo.
echo WARNING: %selectedFilename% already exists in the current folder.
echo.
echo Do you want to overwrite %selectedFilename%?
echo.
echo [1] Yes
echo [2] No
echo.
set /p overwriteChoice="Waiting - "
set overwriteChoice=!overwriteChoice: =!
echo.
if "!overwriteChoice!"=="1" (
goto checkWine
)
goto selectFilename
)
REM Wine doesn't support powershell
:checkWine
if /i %selectedFilename%=="d3d12.dll" (
echo WARNING: This proxy has a reported Streamline conflict that can grey out
echo Cyberpunk's Ray Reconstruction option. Try dxgi.dll or another compatible
echo proxy if that happens. Back up existing ReShade or other loaders first.
echo See INSTALL-DLSSNR.md for the confirmed upstream report.
)
reg query HKEY_CURRENT_USER\Software\Wine\DllOverrides >nul 2>&1
if %errorlevel%==0 (
echo.
echo Using wine, skipping over spoofing checks.
echo If you need, you can disable spoofing by setting Dxgi=false in the config
echo.
pause
goto completeSetup
)
if exist %windir%\system32\nvapi64.dll (
echo.
echo Nvidia driver files detected.
set isNvidia=true
) else (
set isNvidia=false
)
REM Query user for GPU type
echo.
echo Are you using an Nvidia GPU or AMD/Intel GPU?
echo.
echo [1] AMD/Intel
echo [2] Nvidia
echo.
:gpuPrompt
if "%isNvidia%"=="true" (
set /p gpuChoice="Enter 1 or 2 (Detected Nvidia): "
) else (
set /p gpuChoice="Enter 1 or 2 (Detected AMD/Intel): "
)
if "%gpuChoice%"=="1" goto gpuValid
if "%gpuChoice%"=="2" goto gpuValid
echo Invalid input. Please enter 1 or 2.
echo.
goto gpuPrompt
:gpuValid
REM Skip spoofing if Nvidia
if "%gpuChoice%"=="2" (
goto completeSetup
)
REM Query user for DLSS
echo.
echo Will you try to use DLSS inputs to replace with FSR/XeSS? (enables Nvidia spoofing, required for DLSS-FG, Reflex-^>AL2)
echo If you want to change the setting later, edit OptiScaler.ini and set Dxgi=false to disable spoofing and reverse.
echo.
echo [1] Yes
echo [2] No
echo.
set /p enablingSpoofing="Enter 1 or 2 (or press Enter for Yes): "
set configFile=OptiScaler.ini
if "%enablingSpoofing%"=="2" (
if not exist "%configFile%" (
echo Config file not found: %configFile%
pause
)
powershell -Command "(Get-Content '%configFile%') -replace 'Dxgi=auto', 'Dxgi=false' | Set-Content '%configFile%'"
)
REM Decide whether to run OptiPatcher
echo.
if "%gpuChoice%"=="1" (
echo AMD/Intel GPU detected - running OptiPatcher check.
goto checkExistingOptiPatcher
)
:checkExistingOptiPatcher
set "foundOptiPatcher="
for %%F in (OptiScaler\plugins\*OptiPatcher*.asi) do (
set "foundOptiPatcher=%%F"
)
if defined foundOptiPatcher (
echo.
echo OptiPatcher found: !foundOptiPatcher!
echo If the existing version works properly, might be best to keep it.
echo Do you want to re-download a possibly newer version?
echo.
echo [1] Yes
echo [2] No
echo.
set /p optiRedownload="Waiting - "
if /i "!optiRedownload!"=="1" (
echo.
echo Deleting !foundOptiPatcher!...
del "!foundOptiPatcher!"
goto checkOptiPatcher
) else (
echo.
echo Keeping existing OptiPatcher - skipping download.
goto completeSetup
)
)
REM Not installed - continue to download
goto checkOptiPatcher
:checkOptiPatcher
REM Check connectivity
echo.
echo Checking for OptiPatcher compatibility...
echo Press Ctrl+C if this gets stuck to skip to setup completion.
ping -n 1 -w 3000 github.com >nul 2>&1
if %errorlevel% neq 0 (
echo Offline or GitHub blocked. Skipping OptiPatcher check.
goto completeSetup
)
set "OPTI_MATCH=NO"
for /f "usebackq tokens=*" %%A in (`powershell -Command "& { $rawUrl = 'https://raw.githubusercontent.com/optiscaler/OptiPatcher/main/OptiPatcher/dllmain.cpp'; try { $code = (Invoke-WebRequest -Uri $rawUrl -UseBasicParsing).Content } catch { return 'ERR' }; $supported = @(); $ueMatches = [Regex]::Matches($code, 'CHECK_UE\s*\(\s*([a-zA-Z0-9_]+)\s*\)'); foreach ($m in $ueMatches) { $base = $m.Groups[1].Value; $supported += ($base + '-win64-shipping.exe').ToLower(); $supported += ($base + '-wingdk-shipping.exe').ToLower(); }; $directMatches = [Regex]::Matches($code, 'exeName\s*==\s*[\x22\x27]([^\x22\x27]+)[\x22\x27]'); foreach ($m in $directMatches) { $supported += $m.Groups[1].Value.ToLower(); }; $localFiles = Get-ChildItem *.exe | Select-Object -ExpandProperty Name; foreach ($file in $localFiles) { if ($supported -contains $file.ToLower()) { Write-Output 'YES'; exit; } }; Write-Output 'NO'; }"`) do (
set "OPTI_MATCH=%%A"
)
if "!OPTI_MATCH!"=="YES" (
echo.
echo OptiPatcher support detected^^!
echo An Opti plugin used for unlocking DLSS/DLSS-FG inputs, avoiding spoofing and performance overhead in supported games.
echo More info available on OptiPatcher Github
echo.
echo Download OptiPatcher.asi?
echo.
echo [1] Yes
echo [2] No
echo.
set /p downloadOptiPatcher="Waiting - "
set downloadOptiPatcher=!downloadOptiPatcher: =!
if "!downloadOptiPatcher!"=="1" (
echo.
echo Preparing plugins folder...
if not exist "OptiScaler\plugins" mkdir "OptiScaler\plugins"
echo Downloading OptiPatcher...
echo Press Ctrl+C if this gets stuck to skip to setup completion.
echo.
powershell -Command "Invoke-WebRequest -Uri 'https://github.com/optiscaler/OptiPatcher/releases/download/rolling/OptiPatcher.asi' -OutFile 'OptiScaler\plugins\OptiPatcher.asi'"
if errorlevel 1 goto completeSetup
if exist "OptiScaler\plugins\OptiPatcher.asi" (
echo OptiPatcher.asi downloaded successfully.
echo Enabling ASI loading in OptiScaler.ini...
if exist "%configFile%" (
powershell -Command "(Get-Content '%configFile%') -replace 'LoadAsiPlugins=auto', 'LoadAsiPlugins=true' | Set-Content '%configFile%'"
echo Successfully enabled ASI loading in OptiScaler.ini^^!
) else (
echo Warning: OptiScaler.ini not found, could not enable LoadAsiPlugins.
)
) else (
echo Failed to download OptiPatcher.asi.
)
timeout /t 3
)
)
echo.
goto completeSetup
:completeSetup
REM Rename OptiScaler file
echo.
if "!overwriteChoice!"=="1" (
echo Removing previous %selectedFilename%...
del /F %selectedFilename%
)
echo Renaming OptiScaler file to %selectedFilename%...
rename "%optiScalerFile%" %selectedFilename%
if errorlevel 1 (
echo.
echo ERROR: Failed to rename OptiScaler file to %selectedFilename%. Most likely due to folder permissions issues.
echo Please rename OptiScaler.dll manually to %selectedFilename%^^! No need to run setup BAT again after that.
echo.
goto end
)
goto create_uninstaller
:create_uninstaller_return
cls
echo OptiScaler setup completed successfully...
echo.
echo ___
echo (_ '
echo /__ /) / () (/
echo _/ /
echo.
set setupSuccess=true
REM --- DLSS 5 Neural Rendering ---------------------------------------------------------------
REM The proprietary model/runtime cannot be redistributed here, so the user has to supply either
REM NVIDIA's original build or the GPU-compatible community build. Hashing it here catches the
REM Blackwell-only runtime on an older card before the game fails without an obvious explanation.
echo.
echo ------------------------------------------------------------------
echo DLSS 5 Neural Rendering
echo ------------------------------------------------------------------
echo.
set "dlssnrStockHash=E16BCF15E16E13F527491CDF7845B2FE6521A738D8F7C9C721866A8496E1FC8E"
set "dlssnrCrossGenHash=E67DEE209320CDAFE0E93E45675D7AA34323A53ACC57A72B2E40A181581C989A"
set "dlssnrHash="
if exist "nvngx_dlssnr.dll" for /f "skip=1 tokens=*" %%H in ('certutil -hashfile "nvngx_dlssnr.dll" SHA256') do if not defined dlssnrHash set "dlssnrHash=%%H"
set "dlssnrHash=!dlssnrHash: =!"
if exist "nvngx_dlssnr.dll" (
echo nvngx_dlssnr.dll found here.
echo SHA-256: !dlssnrHash!
echo.
if /i "!dlssnrHash!"=="!dlssnrCrossGenHash!" (
echo ShortFuse cross-generation runtime detected.
echo This build supports RTX 20, 30, 40, and 50 series GPUs.
) else if /i "!dlssnrHash!"=="!dlssnrStockHash!" (
echo Original NVIDIA 310.8 runtime detected.
echo This file is for RTX 50. RTX 20, 30, and 40 users must replace
echo it with ShortFuse's pinned cross-generation compatibility runtime.
) else (
echo WARNING: This runtime hash is not one documented by this release.
echo Do not assume that it supports your GPU or came from a trusted source.
)
) else (
echo nvngx_dlssnr.dll was NOT found in this folder.
echo.
echo Neural Rendering needs it, but it cannot be redistributed here.
echo Copy the GPU-appropriate 310.8 runtime into THIS folder - the
echo same one holding the game executable and the renamed OptiScaler.
echo.
echo One copy per game. There is no shared or system-wide location.
)
echo.
echo Two similarly named files matter here, one character apart:
echo.
echo nvngx.dll_dlssnr.dll ships in this package ^(about 13 KB^)
echo nvngx_dlssnr.dll you supply it ^(about 165 MB^)
echo.
echo Runtime required by GPU:
echo RTX 50 original NVIDIA 310.8
echo !dlssnrStockHash!
echo RTX 20/30/40 ShortFuse cross-generation 310.8
echo !dlssnrCrossGenHash!
echo.
echo Obtain the compatibility runtime only from ShortFuse's pinned thread
echo in the RenoDX Discord: https://discord.com/invite/renodx
echo Channel: dlss5-forum ^> Patched DLSS-NR for RTX20, RTX30, and RTX40
echo.
echo The compatibility DLL is modified, so its NVIDIA signature does not
echo validate. Keep security protection on and verify the exact hash above.
echo.
echo Neural Rendering is OFF by default. Turn it on in the OptiScaler
echo overlay under "DLSS Neural Rendering", or set Enabled=true under
echo the DlssNr section of OptiScaler.ini.
echo.
echo RTX 20, 30, 40, and 50 are supported with the correct runtime.
echo Driver 616.56 or newer is required. Start with one pass on RTX 20/30.
echo.
:end
pause
exit /b 0
:create_uninstaller
setlocal DisableDelayedExpansion
(
echo @echo off
echo setlocal EnableDelayedExpansion
echo cls
echo echo :::::::: ::::::::: ::::::::::: ::::::::::: :::::::: :::::::: ::: ::: :::::::::: :::::::::
echo echo :+: :+: :+: :+: :+: :+: :+: :+: :+: :+: :+: :+: :+: :+: :+: :+:
echo echo +:+ +:+ +:+ +:+ +:+ +:+ +:+ +:+ +:+ +:+ +:+ +:+ +:+ +:+
echo echo +#+ +:+ +#++:++#+ +#+ +#+ +#++:++#++ +#+ +#++:++#++: +#+ +#++:++# +#++:++#:
echo echo +#+ +#+ +#+ +#+ +#+ +#+ +#+ +#+ +#+ +#+ +#+ +#+ +#+
echo echo #+# #+# #+# #+# #+# #+# #+# #+# #+# #+# #+# #+# #+# #+# #+#
echo echo ######## ### ### ########### ######## ######## ### ### ########## ########## ### ###
echo echo.
echo echo Coping is strong with this one...
echo echo v2.8 - now with OptiPatcher support
echo echo.
echo REM Check if OptiScaler installation exists
echo set "OLD_FILES_FOUND=0"
echo set "OPTI_DLL_LIST="
echo if exist OptiScaler.asi set "OLD_FILES_FOUND=1"
echo for %%%%F in ^(dxgi.dll winmm.dll d3d12.dll dbghelp.dll version.dll wininet.dll winhttp.dll^) do ^(
echo if exist "%%%%F" ^(
echo set "origname="
echo for /f "tokens=*" %%%%P in ^('powershell -NoProfile -Command "(Get-Item '%%%%F').VersionInfo.OriginalFilename"'^) do ^(
echo set "origname=%%%%P"
echo ^)
echo if /i "!origname!"=="OptiScaler.dll" ^(
echo set "OLD_FILES_FOUND=1"
echo set "OPTI_DLL_LIST=!OPTI_DLL_LIST! %%%%F"
echo ^)
echo ^)
echo ^)
echo if "!OLD_FILES_FOUND!"=="1" ^(
echo echo Existing OptiScaler installation detected^^^^!
echo if exist OptiScaler.asi echo - OptiScaler.asi
echo for %%%%F in ^(!OPTI_DLL_LIST!^) do echo - %%%%F - original filename: OptiScaler.dll
echo echo.
echo ^)
echo echo Do you want to remove OptiScaler?
echo echo.
echo echo [1] Yes
echo echo [2] No
echo echo.
echo set /p removeChoice="Waiting - "
echo echo.
echo if "%%removeChoice%%"=="1" ^(
echo del OptiScaler.log
echo del OptiScaler.ini
echo del OptiScaler.asi
echo for %%%%F in ^(!OPTI_DLL_LIST!^) do ^(del "%%%%F"^)
echo del /Q Licenses\*
echo rd Licenses
echo del /Q OptiScaler\D3D12_Optiscaler\*
echo rd OptiScaler\D3D12_Optiscaler
echo del /Q OptiScaler\Streamline\*
echo rd OptiScaler\Streamline
echo del /Q OptiScaler\streamline\*
echo rd OptiScaler\streamline
echo echo.
echo echo Deleting OptiPatcher if present
echo del /Q OptiScaler\plugins\*
echo rd OptiScaler\plugins
echo echo.
echo del /Q OptiScaler\*
echo rd OptiScaler
echo echo.
echo echo OptiScaler removed^^^^! Ignore the warnings about missing files.
echo echo.
echo ^) else ^(
echo echo.
echo echo Operation cancelled.
echo echo.
echo ^)
echo.
echo pause
echo if "%%removeChoice%%"=="1" ^(
echo del "%%~nx0"
echo ^)
) > "Remove_OptiScaler.bat"
endlocal
echo.
echo Uninstaller created.
echo.
goto create_uninstaller_return