# HG changeset patch # User herrick # Date 1565638037 14400 # Node ID 9b19a9cd651c83d95e3617babc6593cb57cd52da # Parent 1825d29340ee9c77765a6ad84d2a849ace9060ff 8227172: revert JDK-8225569 on windows Reviewed-by: kcr, asemenyuk diff -r 1825d29340ee -r 9b19a9cd651c src/jdk.jpackage/windows/classes/jdk/jpackage/internal/WinAppBundler.java --- a/src/jdk.jpackage/windows/classes/jdk/jpackage/internal/WinAppBundler.java Sat Aug 10 10:02:54 2019 -0400 +++ b/src/jdk.jpackage/windows/classes/jdk/jpackage/internal/WinAppBundler.java Mon Aug 12 15:27:17 2019 -0400 @@ -150,7 +150,7 @@ public static String getLauncherRelativePath( Map p) { - return "bin" + File.separator + getAppName(p) + ".exe"; + return getAppName(p) + ".exe"; } public boolean bundle(Map p, File outputDirectory) diff -r 1825d29340ee -r 9b19a9cd651c src/jdk.jpackage/windows/classes/jdk/jpackage/internal/WindowsAppImageBuilder.java --- a/src/jdk.jpackage/windows/classes/jdk/jpackage/internal/WindowsAppImageBuilder.java Sat Aug 10 10:02:54 2019 -0400 +++ b/src/jdk.jpackage/windows/classes/jdk/jpackage/internal/WindowsAppImageBuilder.java Mon Aug 12 15:27:17 2019 -0400 @@ -126,7 +126,7 @@ this.appModsDir = appDir.resolve("mods"); this.runtimeDir = root.resolve("runtime"); this.mdir = runtimeDir.resolve("lib"); - this.binDir = root.resolve("bin"); + this.binDir = root; Files.createDirectories(appDir); Files.createDirectories(runtimeDir); } diff -r 1825d29340ee -r 9b19a9cd651c src/jdk.jpackage/windows/classes/jdk/jpackage/internal/resources/template.iss --- a/src/jdk.jpackage/windows/classes/jdk/jpackage/internal/resources/template.iss Sat Aug 10 10:02:54 2019 -0400 +++ b/src/jdk.jpackage/windows/classes/jdk/jpackage/internal/resources/template.iss Mon Aug 12 15:27:17 2019 -0400 @@ -26,7 +26,7 @@ Compression=lzma SolidCompression=yes PrivilegesRequired=APPLICATION_INSTALL_PRIVILEGE -SetupIconFile=INSTALLER_NAME\bin\LAUNCHER_NAME.ico +SetupIconFile=INSTALLER_NAME\LAUNCHER_NAME.ico UninstallDisplayIcon={app}\LAUNCHER_NAME.ico UninstallDisplayName=INSTALLER_NAME WizardImageStretch=No @@ -38,21 +38,21 @@ Name: "english"; MessagesFile: "compiler:Default.isl" [Files] -Source: "INSTALLER_NAME\bin\LAUNCHER_NAME.exe"; DestDir: "{app}"; Flags: ignoreversion +Source: "INSTALLER_NAME\LAUNCHER_NAME.exe"; DestDir: "{app}"; Flags: ignoreversion Source: "INSTALLER_NAME\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs [Icons] -Name: "{group}\INSTALLER_NAME"; Filename: "{app}\bin\LAUNCHER_NAME.exe"; IconFilename: "{app}\bin\LAUNCHER_NAME.ico"; Check: APPLICATION_MENU_SHORTCUT() -Name: "{commondesktop}\INSTALLER_NAME"; Filename: "{app}\bin\LAUNCHER_NAME.exe"; IconFilename: "{app}\bin\LAUNCHER_NAME.ico"; Check: APPLICATION_DESKTOP_SHORTCUT() +Name: "{group}\INSTALLER_NAME"; Filename: "{app}\LAUNCHER_NAME.exe"; IconFilename: "{app}\LAUNCHER_NAME.ico"; Check: APPLICATION_MENU_SHORTCUT() +Name: "{commondesktop}\INSTALLER_NAME"; Filename: "{app}\LAUNCHER_NAME.exe"; IconFilename: "{app}\LAUNCHER_NAME.ico"; Check: APPLICATION_DESKTOP_SHORTCUT() ADD_LAUNCHERS [Run] -Filename: "{app}\bin\RUN_FILENAME.exe"; Parameters: "-Xappcds:generatecache"; Check: APPLICATION_APP_CDS_INSTALL() -Filename: "{app}\bin\RUN_FILENAME.exe"; Description: "{cm:LaunchProgram,INSTALLER_NAME}"; Flags: nowait postinstall skipifsilent; Check: APPLICATION_NOT_SERVICE() -Filename: "{app}\bin\RUN_FILENAME.exe"; Parameters: "-install -svcName ""INSTALLER_NAME"" -svcDesc ""APPLICATION_DESCRIPTION"" -mainExe ""APPLICATION_LAUNCHER_FILENAME"" START_ON_INSTALL RUN_AT_STARTUP"; Check: APPLICATION_SERVICE() +Filename: "{app}\RUN_FILENAME.exe"; Parameters: "-Xappcds:generatecache"; Check: APPLICATION_APP_CDS_INSTALL() +Filename: "{app}\RUN_FILENAME.exe"; Description: "{cm:LaunchProgram,INSTALLER_NAME}"; Flags: nowait postinstall skipifsilent; Check: APPLICATION_NOT_SERVICE() +Filename: "{app}\RUN_FILENAME.exe"; Parameters: "-install -svcName ""INSTALLER_NAME"" -svcDesc ""APPLICATION_DESCRIPTION"" -mainExe ""APPLICATION_LAUNCHER_FILENAME"" START_ON_INSTALL RUN_AT_STARTUP"; Check: APPLICATION_SERVICE() [UninstallRun] -Filename: "{app}\bin\RUN_FILENAME.exe "; Parameters: "-uninstall -svcName INSTALLER_NAME STOP_ON_UNINSTALL"; Check: APPLICATION_SERVICE() +Filename: "{app}\RUN_FILENAME.exe "; Parameters: "-uninstall -svcName INSTALLER_NAME STOP_ON_UNINSTALL"; Check: APPLICATION_SERVICE() [Code] function returnTrue(): Boolean; diff -r 1825d29340ee -r 9b19a9cd651c src/jdk.jpackage/windows/native/libapplauncher/WindowsPlatform.cpp --- a/src/jdk.jpackage/windows/native/libapplauncher/WindowsPlatform.cpp Sat Aug 10 10:02:54 2019 -0400 +++ b/src/jdk.jpackage/windows/native/libapplauncher/WindowsPlatform.cpp Mon Aug 12 15:27:17 2019 -0400 @@ -151,8 +151,7 @@ } TString WindowsPlatform::GetPackageLauncherDirectory() { - return FilePath::IncludeTrailingSeparator( - GetPackageRootDirectory()) + _T("bin"); + return GetPackageRootDirectory(); } TString WindowsPlatform::GetPackageRuntimeBinDirectory() { @@ -174,14 +173,7 @@ TString WindowsPlatform::GetPackageRootDirectory() { TString result; TString filename = GetModuleFileName(); - TString binPath = FilePath::ExtractFilePath(filename); - - size_t slash = binPath.find_last_of(TRAILING_PATHSEPARATOR); - if (slash != TString::npos) { - result = binPath.substr(0, slash); - } - - return result; + return FilePath::ExtractFilePath(filename); } TString WindowsPlatform::GetAppDataDirectory() { diff -r 1825d29340ee -r 9b19a9cd651c test/jdk/tools/jpackage/helpers/JPackagePath.java --- a/test/jdk/tools/jpackage/helpers/JPackagePath.java Sat Aug 10 10:02:54 2019 -0400 +++ b/test/jdk/tools/jpackage/helpers/JPackagePath.java Mon Aug 12 15:27:17 2019 -0400 @@ -59,7 +59,7 @@ public static String getApp(String name) { if (JPackageHelper.isWindows()) { - return Path.of("output", name, "bin", name + ".exe").toString(); + return Path.of("output", name, name + ".exe").toString(); } else if (JPackageHelper.isOSX()) { return Path.of("output", name + ".app", "Contents", "MacOS", name).toString(); @@ -77,7 +77,7 @@ public static String getAppIcon(String name) { if (JPackageHelper.isWindows()) { - return Path.of("output", name, "bin", name + ".ico").toString(); + return Path.of("output", name, name + ".ico").toString(); } else if (JPackageHelper.isOSX()) { return Path.of("output", name + ".app", "Contents", "Resources", name + ".icns").toString(); @@ -95,7 +95,7 @@ public static String getAppSL(String app, String sl) { if (JPackageHelper.isWindows()) { - return Path.of("output", app, "bin", sl + ".exe").toString(); + return Path.of("output", app, sl + ".exe").toString(); } else if (JPackageHelper.isOSX()) { return Path.of("output", app + ".app", "Contents", "MacOS", sl).toString(); @@ -197,7 +197,7 @@ public static String getWinInstalledApp(String installDir, String testName) { - return Path.of(getWinProgramFiles(), installDir, "bin", + return Path.of(getWinProgramFiles(), installDir, testName + ".exe").toString(); } @@ -255,7 +255,6 @@ public static String getWinUserLocalInstalledApp(String testName) { return getWinUserLocal() + File.separator + testName - + File.separator + "bin" + File.separator + testName + ".exe"; } diff -r 1825d29340ee -r 9b19a9cd651c test/jdk/tools/jpackage/windows/WinConsoleTest.java --- a/test/jdk/tools/jpackage/windows/WinConsoleTest.java Sat Aug 10 10:02:54 2019 -0400 +++ b/test/jdk/tools/jpackage/windows/WinConsoleTest.java Mon Aug 12 15:27:17 2019 -0400 @@ -66,7 +66,7 @@ private static void checkSubsystem(boolean console) throws Exception { Path path = Path.of(console ? OUTPUT_WIN_CONSOLE : OUTPUT, - NAME, "bin", NAME + ".exe"); + NAME, NAME + ".exe"); System.out.println("validate path: " + path.toString()); Base.validate(path.toString());