Skip to content

Commit ee08a19

Browse files
author
heetbeet
committed
Bugfix possible out of sync temp paths. Add better cmd header for .cmd pipeline.
1 parent daf63e1 commit ee08a19

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

src/Create new xlwings project.cmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ if __name__ == "__main__":
7676
f.write(pytext)
7777

7878
# Write out to temp files readible by batch
79-
tmp = Path(tempfile.mktemp()).parent
79+
tmp = Path(os.environ['TEMP'])
8080

8181
with open(tmp.joinpath("xlwings_pyfile.txt"), "w") as f:
8282
f.write(str(pyfile))

vatools/util.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,12 @@ def _():''' 2>nul
99
::*******************************************************
1010
:: This is a .cmd header to define how to run this file
1111
::*******************************************************
12-
call "%localappdata%\PythonVA\bin\python\python" "%~dp0%~n0.cmd"
12+
if not exist "%localappdata%\PythonVA\bin\python\python.exe" (
13+
powershell -command "[reflection.assembly]::LoadWithPartialName('System.Windows.Forms')|out-null;[windows.forms.messagebox]::Show(\"Please install PythonVA in order to run this script:`r`n https://github.com/AutoActuary/PythonVA/releases\", 'PythonVA not installed!')"
14+
exit /b -1
15+
)
16+
17+
call "%localappdata%\PythonVA\bin\python\python.exe" "%~dp0%~n0.cmd"
1318
__pause__
1419
exit /b %errorlevel%
1520
'''

0 commit comments

Comments
 (0)