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

fix: makewin.bat右键以管理员身份运行时会出现bug #29

Merged
merged 2 commits into from
May 21, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion makewin.bat
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
@echo off

:: if started with Administrative Privileges
:: we need to change directory to where this script exists
echo Current path is %cd%
echo Changing directory to the path of the current script
cd /d %~dp0
echo Current path is %cd%


set flag=%1
if %flag%x == x (
set flag=thesis
Expand Down Expand Up @@ -86,7 +94,7 @@ goto:EOF
:thesis
call:checkfiles
latexmk -xelatex main.tex
goto:EOF
goto pauseIfDoubleClicked

:thesisx
call:checkfiles
Expand Down Expand Up @@ -134,3 +142,9 @@ goto:EOF
xelatex cquthesis.dtx
xelatex cquthesis.dtx
goto:EOF

:pauseIfDoubleClicked
setlocal enabledelayedexpansion
set testl=%cmdcmdline:"=%
set testr=!testl:%~nx0=!
if not "%testl%" == "%testr%" pause