diff --git a/windows-msi/msi.wxs b/windows-msi/msi.wxs index 3b6b367e..d892cee0 100644 --- a/windows-msi/msi.wxs +++ b/windows-msi/msi.wxs @@ -85,6 +85,7 @@ + @@ -95,6 +96,7 @@ + @@ -110,6 +112,7 @@ NOT Installed NOT Installed + NOT Installed Detecting system information diff --git a/windows-msi/script/RegisterEventSource.js b/windows-msi/script/RegisterEventSource.js new file mode 100644 index 00000000..de827a44 --- /dev/null +++ b/windows-msi/script/RegisterEventSource.js @@ -0,0 +1,11 @@ +function RegisterEventSource() { + var shell = new ActiveXObject("WScript.Shell"); + var source = "OpenVPNService"; + var logName = "Application"; + + var command = 'powershell -ExecutionPolicy Bypass -Command "if (-not [System.Diagnostics.EventLog]::SourceExists(\'' + + source + '\')) {[System.Diagnostics.EventLog]::CreateEventSource(\'' + + source + '\', \'' + logName + '\')}"'; + + shell.Run(command, 0, true); // 0 = hidden, true = wait until complete +}