修改spark install4j配置文件使得安装程序语言为中文(使得Spark安装程序过程为中文)

http://blog.csdn.net/tyj1982/article/details/6686546

在build/installer目录下,打开spark.install4j文件,做如下修改

<languages skipLanguageSelection="true">
      <principalLanguage id="zh_CN", customLocalizationFile="" />

在mediaSets段下修改默认语言为中文

<mediaSets>
    <win32 name="Windows" id="2" mediaFileName="" installDir="Spark" overridePrincipalLanguage="true" requires64bit="false" runPostProcessor="false" postProcessor="" failOnPostProcessorError="false" includedJRE="windows-x86-1.6.0_18" manualJREEntry="false" bundleType="1" jreURL="" jreFtpURL="" jreShared="false" customInstallBaseDir="" createUninstallIcon="true" contentFilesType="1" downloadURL="" runAsAdmin="true">
      <excludedLaunchers />
      <excludedComponents />
      <overriddenPrincipalLanguage id="zh_CN" customLocalizationFile="" />
      <exclude>
        <entry location="bin/startup.bat" launcher="false" />
        <entry location="bin/startup.sh" launcher="false" />
        <entry location="lib/linux" launcher="false" />
        <entry location="lib/mac" launcher="false" />
        <entry location="plugins/idlelinux.jar" launcher="false" />
      </exclude>
      <variables />
      <excludedInstallerScreens />
      <excludedUninstallerScreens />
    </win32>    
    <win32 name="Windows NON-JRE" id="19" mediaFileName="spark_${compiler:sys.version}_online" installDir="Spark" overridePrincipalLanguage="true" requires64bit="false" runPostProcessor="false" postProcessor="" failOnPostProcessorError="false" includedJRE="" manualJREEntry="false" bundleType="2" jreURL="http://www.jivesoftware.org/updater/releases/windows-x86-1.5.0_05.tar.gz" jreFtpURL="" jreShared="false" customInstallBaseDir="" createUninstallIcon="true" contentFilesType="1" downloadURL="" runAsAdmin="true">
      <excludedLaunchers />
      <excludedComponents />
      <overriddenPrincipalLanguage id="zh_CN" customLocalizationFile="" />
      <exclude>
        <entry location="bin/startup.bat" launcher="false" />
        <entry location="bin/startup.sh" launcher="false" />
        <entry location="lib/linux" launcher="false" />
        <entry location="lib/mac" launcher="false" />
        <entry location="plugins/idlelinux.jar" launcher="false" />
      </exclude>
      <variables />
      <excludedInstallerScreens />
      <excludedUninstallerScreens />
    </win32>
  </mediaSets>

另外,一下这个段可以注释掉:

<launcher name="starter" id="21" external="false" excludeFromMenu="false" menuName="" icnsFile="" pngIcon16File="" pngIcon32File="" macServiceDependencies="" swtApp="false">
      <executable name="starter" type="1" iconSet="false" iconFile="" executableDir="." redirectStderr="true" stderrFile="error.log" redirectStdout="false" stdoutFile="output.log" failOnStderrOutput="true" executableMode="1" changeWorkingDirectory="true" workingDirectory="." singleInstance="false" serviceStartType="2" serviceDependencies="" serviceDescription="" jreLocation="" executionLevel="asInvoker">
        <versionInfo include="false" fileVersion="" fileDescription="" legalCopyright="" internalName="" />
      </executable>
      <splashScreen show="false" autoOff="true" alwaysOnTop="true" width="0" height="0" bitmapFile="">
        <text>
          <statusLine x="20" y="20" text="" font="Arial" fontSize="8" fontColor="0,0,0" fontWeight="500" />
          <versionLine x="20" y="40" text="version ${compiler:sys.version}" font="Arial" fontSize="8" fontColor="0,0,0" fontWeight="500" />
        </text>
      </splashScreen>
      <java mainClass="org.jivesoftware.Restarter" vmParameters="" arguments="" allowVMPassthroughParameters="true" preferredVM="">
        <classPath>
          <scanDirectory location="lib" failOnError="false" />
        </classPath>
        <nativeLibraryDirectories />
      </java>
      <includedFiles />
      <unextractableFiles />
      <customScript mode="1" file="">
        <scriptLines />
      </customScript>
    </launcher>

另外发现添加快捷启动栏无效(在xp下),所以可以把这个选项去掉

<formComponent name="Create a quick launch icon" id="55" beanClass="com.install4j.runtime.beans.formcomponents.CheckboxComponent" insetTop="" insetLeft="" insetBottom="" insetRight="" resetInitOnPrevious="false">
            <serializedBean>
              <java class="java.beans.XMLDecoder">
                <object class="com.install4j.runtime.beans.formcomponents.CheckboxComponent">
                  <void property="checkboxText">
                    <string>${i18n:CreateQuickLaunchIcon}</string>
                  </void>
                  <void property="initiallySelected">
                    <boolean>true</boolean>
                  </void>
                  <void property="variableName">
                    <string>createQuicklaunchIconAction</string>
                  </void>
                </object>
              </java>
            </serializedBean>
            <initScript>component.setVisible(Util.isWindows());</initScript>
          </formComponent>

原文地址:https://www.cnblogs.com/IamThat/p/3090913.html