使用安装程序安装jar时更改属性文件

时间:2015-08-05 14:45:08

标签: windows-installer inno-setup executable-jar

我有一个显示名称的简单java类。

import java.awt.BorderLayout;
import java.awt.Dimension;
import java.io.IOException;
import java.util.Properties;

import javax.swing.JFrame;
import javax.swing.JLabel;
public class DisplayName {

public static void main(String[] args) throws IOException {

    Properties prop = new Properties();
    prop.load(Thread.currentThread().getContextClassLoader()
            .getResourceAsStream("config.properties"));
    String name = prop.getProperty("name");
    String txt = "Hello "+ name + " Welcome!";
    JFrame jframe = new JFrame();
    JLabel emptyLabel = new JLabel(txt);        
    jframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    emptyLabel.setPreferredSize(new Dimension(500, 100));
    jframe.getContentPane().add(emptyLabel, BorderLayout.CENTER);
    jframe.pack();
    jframe.setLocationRelativeTo(null);
    jframe.setVisible(true);

}

}

以下是我的config.properties文件。

1. name = any user input name.

将此应用程序导出为jar文件(Display.jar)并使用launch4j创建.exe文件。

使用Display.exe,使用Inno Setup创建安装程序并将其安装为桌面应用程序。

这就是我要找的东西。在安装安装文件(使用InnoSetup生成)时,我希望用户提供一个名称,该名称会更改我的应用程序使用的属性文件中的name值。

如果有任何工具可以告诉我。

我看过这篇文章,但我不知道vbs,我们也在寻找开源。 http://www.advancedinstaller.com/forums/viewtopic.php?t=21292

0 个答案:

没有答案