Skip to content

Commit

Permalink
The temporary directory is automatically created if it doesn't alread…
Browse files Browse the repository at this point in the history
  • Loading branch information
icnocop committed Aug 9, 2013
1 parent 0b60cb8 commit ab2aa78
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Expand Up @@ -5,7 +5,8 @@ Features
--------

* [#40](https://github.com/dblock/dotnetinstaller/pull/40) - Added support for escape patterns for square brackets (`[\[]` for an open bracket and `[\]]` for a close bracket) - [@montrowe](https://github.com/montrowe).
* [#46](https://github.com/dblock/dotnetinstaller/pull/46) - Added support for hiding command based components' application window when run) - [@icnocop](https://github.com/icnocop).
* [#46](https://github.com/dblock/dotnetinstaller/pull/46) - Added support for hiding command based components' application window when run - [@icnocop](https://github.com/icnocop).
* [#24](https://github.com/dblock/dotnetinstaller/issues/24) - The temporary directory is automatically created if it doesn't already exist - [@icnocop](https://github.com/icnocop).

Bugs
----
Expand Down
9 changes: 9 additions & 0 deletions dotNetInstallerToolsLib/PathUtil.cpp
Expand Up @@ -3,6 +3,7 @@
#include "StringUtil.h"
#include "ExceptionMacros.h"
#include "ErrorUtil.h"
#include "DirectoryUtil.h"

std::string DVLib::GetFileDirectoryA(const std::string& path)
{
Expand Down Expand Up @@ -89,6 +90,10 @@ std::string DVLib::GetTemporaryDirectoryA()
char td[MAX_PATH] = { 0 };
CHECK_WIN32_BOOL(GetTempPathA(MAX_PATH, td),
L"GetTempPathA");

// create temporary directory if it doesn't already exist
DVLib::DirectoryCreate(td);

return td;
}

Expand All @@ -97,6 +102,10 @@ std::wstring DVLib::GetTemporaryDirectoryW()
wchar_t td[MAX_PATH] = { 0 };
CHECK_WIN32_BOOL(::GetTempPathW(MAX_PATH, td),
"GetTempPathW");

// create temporary directory if it doesn't already exist
DVLib::DirectoryCreate(td);

return td;
}

Expand Down

0 comments on commit ab2aa78

Please sign in to comment.