src/jdk.jpackage/windows/classes/jdk/jpackage/internal/WinMsiBundler.java
branchJDK-8200758-branch
changeset 57213 8ff0a29bf9bc
parent 57181 d10b861e8d62
child 57219 bfa094e6ce15
equal deleted inserted replaced
57198:fac5bd3a361d 57213:8ff0a29bf9bc
   607             data.put("INSTALL_SCOPE", "perMachine");
   607             data.put("INSTALL_SCOPE", "perMachine");
   608         } else {
   608         } else {
   609             data.put("INSTALL_SCOPE", "perUser");
   609             data.put("INSTALL_SCOPE", "perUser");
   610         }
   610         }
   611 
   611 
   612         if (BIT_ARCH_64.fetchFrom(params)) {
   612         data.put("PLATFORM", "x64");
   613             data.put("PLATFORM", "x64");
   613         data.put("WIN64", "yes");
   614             data.put("WIN64", "yes");
       
   615         } else {
       
   616             data.put("PLATFORM", "x86");
       
   617             data.put("WIN64", "no");
       
   618         }
       
   619 
   614 
   620         data.put("UI_BLOCK", getUIBlock(params));
   615         data.put("UI_BLOCK", getUIBlock(params));
   621 
   616 
   622         List<Map<String, ? super Object>> secondaryLaunchers =
   617         List<Map<String, ? super Object>> secondaryLaunchers =
   623                 SECONDARY_LAUNCHERS.fetchFrom(params);
   618                 SECONDARY_LAUNCHERS.fetchFrom(params);
   746 
   741 
   747         // have files => need to output component
   742         // have files => need to output component
   748         out.println(prefix + " <Component Id=\"comp" + (compId++)
   743         out.println(prefix + " <Component Id=\"comp" + (compId++)
   749                 + "\" DiskId=\"1\""
   744                 + "\" DiskId=\"1\""
   750                 + " Guid=\"" + UUID.randomUUID().toString() + "\""
   745                 + " Guid=\"" + UUID.randomUUID().toString() + "\""
   751                 + (BIT_ARCH_64.fetchFrom(params) ? " Win64=\"yes\"" : "")
   746                 + " Win64=\"yes\"" 
   752                 + ">");
   747                 + ">");
   753         out.println(prefix + "  <CreateFolder/>");
   748         out.println(prefix + "  <CreateFolder/>");
   754         out.println(prefix + "  <RemoveFolder Id=\"RemoveDir"
   749         out.println(prefix + "  <RemoveFolder Id=\"RemoveDir"
   755                 + (id++) + "\" On=\"uninstall\" />");
   750                 + (id++) + "\" On=\"uninstall\" />");
   756 
   751 
   803 
   798 
   804             out.println(prefix + "   <File Id=\"" +
   799             out.println(prefix + "   <File Id=\"" +
   805                     thisFileId + "\""
   800                     thisFileId + "\""
   806                     + " Name=\"" + f.getName() + "\" "
   801                     + " Name=\"" + f.getName() + "\" "
   807                     + " Source=\"" + relativePath(imageRootDir, f) + "\""
   802                     + " Source=\"" + relativePath(imageRootDir, f) + "\""
   808                     + (BIT_ARCH_64.fetchFrom(params) ?
   803                     + " ProcessorArchitecture=\"x64\"" + ">");
   809                     " ProcessorArchitecture=\"x64\"" : "") + ">");
       
   810             if (doShortcuts && desktopShortcut) {
   804             if (doShortcuts && desktopShortcut) {
   811                 out.println(prefix
   805                 out.println(prefix
   812                         + "  <Shortcut Id=\"desktopShortcut\" Directory="
   806                         + "  <Shortcut Id=\"desktopShortcut\" Directory="
   813                         + "\"DesktopFolder\""
   807                         + "\"DesktopFolder\""
   814                         + " Name=\"" + APP_NAME.fetchFrom(params)
   808                         + " Name=\"" + APP_NAME.fetchFrom(params)
   961         out.println("<Include>");
   955         out.println("<Include>");
   962 
   956 
   963         out.println(" <Directory Id=\"TARGETDIR\" Name=\"SourceDir\">");
   957         out.println(" <Directory Id=\"TARGETDIR\" Name=\"SourceDir\">");
   964         if (MSI_SYSTEM_WIDE.fetchFrom(params)) {
   958         if (MSI_SYSTEM_WIDE.fetchFrom(params)) {
   965             // install to programfiles
   959             // install to programfiles
   966             if (BIT_ARCH_64.fetchFrom(params)) {
   960             out.println("  <Directory Id=\"ProgramFiles64Folder\" "
   967                 out.println("  <Directory Id=\"ProgramFiles64Folder\" "
       
   968                         + "Name=\"PFiles\">");
   961                         + "Name=\"PFiles\">");
   969             } else {
       
   970                 out.println("  <Directory Id=\"ProgramFilesFolder\" "
       
   971                         + "Name=\"PFiles\">");
       
   972             }
       
   973         } else {
   962         } else {
   974             // install to user folder
   963             // install to user folder
   975             out.println(
   964             out.println(
   976                     "  <Directory Name=\"AppData\" Id=\"LocalAppDataFolder\">");
   965                     "  <Directory Name=\"AppData\" Id=\"LocalAppDataFolder\">");
   977         }
   966         }
   995             out.println("  <Directory Id=\"ProgramMenuFolder\">");
   984             out.println("  <Directory Id=\"ProgramMenuFolder\">");
   996             out.println("    <Directory Id=\"ProgramMenuDir\" Name=\""
   985             out.println("    <Directory Id=\"ProgramMenuDir\" Name=\""
   997                     + MENU_GROUP.fetchFrom(params) + "\">");
   986                     + MENU_GROUP.fetchFrom(params) + "\">");
   998             out.println("      <Component Id=\"comp" + (compId++) + "\""
   987             out.println("      <Component Id=\"comp" + (compId++) + "\""
   999                     + " Guid=\"" + UUID.randomUUID().toString() + "\""
   988                     + " Guid=\"" + UUID.randomUUID().toString() + "\""
  1000                     + (BIT_ARCH_64.fetchFrom(params) ? " Win64=\"yes\"" : "")
   989                     + " Win64=\"yes\""
  1001                     + ">");
   990                     + ">");
  1002             out.println("        <RemoveFolder Id=\"ProgramMenuDir\" "
   991             out.println("        <RemoveFolder Id=\"ProgramMenuDir\" "
  1003                     + "On=\"uninstall\" />");
   992                     + "On=\"uninstall\" />");
  1004             // This has to be under HKCU to make WiX happy.
   993             // This has to be under HKCU to make WiX happy.
  1005             // There are numberous discussions on this amoung WiX users
   994             // There are numberous discussions on this amoung WiX users