mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
[ArchiveTools] Use more robust tempfile naming
This commit is contained in:
@@ -1112,7 +1112,7 @@ namespace SabreTools.Helper.Tools
|
||||
public static bool WriteTAR(List<string> inputFiles, string outDir, List<Rom> roms, Logger logger, bool date = false)
|
||||
{
|
||||
bool success = false;
|
||||
string tempFile = Path.GetTempFileName();
|
||||
string tempFile = Path.Combine(Path.GetTempPath(), "tmp" + Guid.NewGuid().ToString());
|
||||
|
||||
// If either list of roms is null or empty, return
|
||||
if (inputFiles == null || roms == null || inputFiles.Count == 0 || roms.Count == 0)
|
||||
@@ -1231,7 +1231,7 @@ namespace SabreTools.Helper.Tools
|
||||
else
|
||||
{
|
||||
// Get the stream from the original archive
|
||||
string tempEntry = Path.GetTempFileName();
|
||||
string tempEntry = Path.Combine(Path.GetTempPath(), "tmp" + Guid.NewGuid().ToString());
|
||||
oldTarFile.Entries.Where(e => e.Key == key).ToList()[0].WriteToFile(tempEntry);
|
||||
|
||||
// Copy the input stream to the output
|
||||
@@ -1527,7 +1527,7 @@ namespace SabreTools.Helper.Tools
|
||||
public static bool WriteTorrentZip(List<string> inputFiles, string outDir, List<Rom> roms, Logger logger, bool date = false)
|
||||
{
|
||||
bool success = false;
|
||||
string tempFile = Path.GetTempFileName();
|
||||
string tempFile = Path.Combine(Path.GetTempPath(), "tmp" + Guid.NewGuid().ToString());
|
||||
|
||||
// If either list of roms is null or empty, return
|
||||
if (inputFiles == null || roms == null || inputFiles.Count == 0 || roms.Count == 0)
|
||||
|
||||
46
build.bat
Normal file
46
build.bat
Normal file
@@ -0,0 +1,46 @@
|
||||
@echo off
|
||||
|
||||
set configuration=Mono
|
||||
set platform=x64
|
||||
|
||||
echo ------------------------
|
||||
echo [ Build SabreTools ]
|
||||
echo ------------------------
|
||||
echo.
|
||||
|
||||
REM Set the configuration
|
||||
:Configuration
|
||||
|
||||
echo What configuration do you want?
|
||||
echo 1) Debug
|
||||
echo 2) Release
|
||||
echo 3) Mono [Default]
|
||||
|
||||
set /P confgnum="> "
|
||||
|
||||
if "%confignum%"=="1" ( set configuration=Debug )
|
||||
if "%confignum%"=="2" ( set configuration=Release )
|
||||
if "%confignum%"=="3" ( set configuration=Mono )
|
||||
if "%confignum%"=="" ( set configuration=Mono )
|
||||
|
||||
REM Set the platform
|
||||
:Platform
|
||||
|
||||
echo.
|
||||
echo What platform do you want?
|
||||
echo 1) AnyCPU
|
||||
echo 2) x64 [Default]
|
||||
|
||||
set /P platnum="> "
|
||||
|
||||
if "%platnum%"=="1" ( set platform=AnyCPU )
|
||||
if "%platnum%"=="2" ( set platform=x64 )
|
||||
if "%platnum%"=="" ( set platform=x64 )
|
||||
|
||||
REM Now run the command
|
||||
:Command
|
||||
|
||||
@echo on
|
||||
"C:\Program Files (x86)\MSBuild\14.0\Bin\MSBuild.exe" SabreTools.sln /property:Configuration=%configuration% /property:Platform=%platform%
|
||||
|
||||
pause
|
||||
Reference in New Issue
Block a user