Skip to content

Commit

Permalink
Fixes installation by using ASCII.
Browse files Browse the repository at this point in the history
  • Loading branch information
lygstate committed Feb 7, 2018
1 parent ecfaa69 commit bfe6ea8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
9 changes: 5 additions & 4 deletions starter/NotepadStarterInstall.bat
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
::通过使用短文件路径,支持放在Unicode路径下。
::By using short path, to support place in Unicode Path
@echo on
echo Args:[%*]
if not "%1"=="ReplaceSystemNotepad" (
Expand Down Expand Up @@ -28,7 +28,7 @@ set "NotepadStarter=%CD%\NotepadStarter.exe"
if not exist "%NotepadStarter%" ( goto NoNotepadPlusPlusOrNotepadStarter )
if not exist "%NotepadPlusPlus%" ( goto NoNotepadPlusPlusOrNotepadStarter )

::获取管理员权限
::Gain Administrator permission
set SHOW_SUBWINDOW=0
call "%~dps0request-admin.bat" "%~dpnxs0" %*

Expand All @@ -48,7 +48,7 @@ reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution
reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\notepad.exe" /f /v "readme" /t REG_SZ /d "call NotepadStarter.exe instead of original notepad.exe! To disable this option just remove notepad.exe entry"

:NoNotepadPlusPlusOrNotepadStarter
::pause
pause

goto :eof
:ReplaceNotepad -Passing the directory have notepad.exe who will be replaced
Expand All @@ -58,7 +58,8 @@ cd /d "%~1"
if not exist "notepad.exe" (goto CopyNotepad)
takeown /f notepad.exe
echo Y | cacls notepad.exe /Grant Administrators:F
echo N | move /-Y notepad.exe notepad.NotepadStarter.exe
del /F notepad.NotepadStarter.exe
rename notepad.exe notepad.NotepadStarter.exe
:CopyNotepad
copy /Y "%NotepadStarter%" notepad.exe
endlocal
Expand Down
4 changes: 2 additions & 2 deletions starter/NotepadStarterUninstall.bat
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
::通过使用短文件路径,支持放在Unicode路径下。
::By using short path, to support place in Unicode Path
@echo off

::获取管理员权限
::Gain Administrator permission
set SHOW_SUBWINDOW=0
call "%~dps0request-admin.bat" "%~dpnxs0" %*

Expand Down

0 comments on commit bfe6ea8

Please sign in to comment.