Skip to content

Commit

Permalink
Prepare for release. Disable non-production things.
Browse files Browse the repository at this point in the history
  • Loading branch information
eiz committed Nov 11, 2017
1 parent b6ca06a commit 09633d0
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 4 deletions.
18 changes: 14 additions & 4 deletions SarAsio/dllmain.cpp
Expand Up @@ -14,6 +14,10 @@
// You should have received a copy of the GNU General Public License
// along with SynchronousAudioRouter. If not, see <http://www.gnu.org/licenses/>.

// Microsoft thinks getenv is insecure, presumably because setenv/putenv are not
// thread safe? I think it's going to be ok.
#define _CRT_SECURE_NO_WARNINGS

#include "stdafx.h"
#include "dllmain.h"
#include "utility.h"
Expand All @@ -28,10 +32,16 @@ BOOL WINAPI DllMain(HMODULE hModule, DWORD reason, LPVOID reserved)
FLAGS_log_dir = Sar::LoggingPath();
FLAGS_logbuflevel = -1;

GetModuleFileNameA(nullptr, buf, 1024);
google::InitGoogleLogging(
*buf ? _strdup(PathFindFileNameA(buf)) : "SarAsio");
LOG(INFO) << "Initializing SarAsio.";
char *sarLogVar = getenv("SAR_ASIO_LOG");

if (sarLogVar && atoi(sarLogVar)) {
GetModuleFileNameA(nullptr, buf, 1024);
google::InitGoogleLogging(
*buf ? _strdup(PathFindFileNameA(buf)) : "SarAsio");
LOG(INFO) << "Initializing SarAsio.";
} else {
LOG(INFO) << "Logging disabled. (This shouldn't log.)";
}
}

gDllModule = hModule;
Expand Down
6 changes: 6 additions & 0 deletions SarInstaller/Product.wxs
Expand Up @@ -61,24 +61,28 @@
Execute="deferred"
Impersonate="no"
Return="check"/>
<!--
<CustomAction Id="InstallNdisFilter"
BinaryKey="SarInstallerActions"
DllEntry="InstallNdisFilter"
Execute="deferred"
Impersonate="no"
Return="check"/>
-->
<CustomAction Id="RemoveDeviceNode"
BinaryKey="SarInstallerActions"
DllEntry="RemoveDeviceNode"
Execute="deferred"
Impersonate="no"
Return="check"/>
<!--
<CustomAction Id="UninstallNdisFilter"
BinaryKey="SarInstallerActions"
DllEntry="UninstallNdisFilter"
Execute="deferred"
Impersonate="no"
Return="check"/>
-->

<InstallExecuteSequence>
<Custom Action="CreateDeviceNode.SetProperty" After="InstallFiles">
Expand All @@ -87,12 +91,14 @@
<Custom Action="CreateDeviceNode" After="CreateDeviceNode.SetProperty">
NOT Installed AND NOT REMOVE
</Custom>
<!-- Disabled until NDIS driver is mature.
<Custom Action="InstallNdisFilter" After="MsiProcessDrivers">
NOT Installed AND NOT REMOVE
</Custom>
<Custom Action="UninstallNdisFilter" Before="MsiProcessDrivers">
REMOVE
</Custom>
-->
<Custom Action="RemoveDeviceNode" Before="RemoveFiles">
REMOVE
</Custom>
Expand Down

0 comments on commit 09633d0

Please sign in to comment.