src/jdk.jpackage/windows/native/msiwrapper/MsiWrapper.cpp
branchJDK-8200758-branch
changeset 57444 91e9d4691e5e
parent 57413 45c74e654794
child 57909 c7de06ed4b54
--- a/src/jdk.jpackage/windows/native/msiwrapper/MsiWrapper.cpp	Fri Jun 28 16:49:32 2019 -0400
+++ b/src/jdk.jpackage/windows/native/msiwrapper/MsiWrapper.cpp	Fri Jun 28 16:50:51 2019 -0400
@@ -1,13 +1,14 @@
+#include <algorithm>
 #include <windows.h>
 
-#include "WinSysInfo.h"
+#include "SysInfo.h"
 #include "FileUtils.h"
 #include "Executor.h"
 #include "Resources.h"
 #include "WinErrorHandling.h"
 
 
-int wmain(int argc, wchar_t *argv[])
+int __stdcall WinMain(HINSTANCE, HINSTANCE, LPSTR lpCmdLine, int nShowCmd)
 {
     JP_TRY;
 
@@ -26,12 +27,15 @@
     // Setup executor to run msiexec
     Executor msiExecutor(SysInfo::getWIPath());
     msiExecutor.arg(L"/i").arg(msiPath);
-    for (int i = 1; i < argc; ++i) {
-        msiExecutor.arg(argv[i]);
-    }
+    const auto args = SysInfo::getCommandArgs();
+    std::for_each(args.begin(), args.end(), [&msiExecutor] (const tstring& arg) {
+        msiExecutor.arg(arg);
+    });
 
     // Install msi file.
     return msiExecutor.execAndWaitForExit();
 
     JP_CATCH_ALL;
+
+    return -1;
 }