public static void moveSQLite(){
File source = new File("C:\\Users\\User\\Desktop\\System.Data.SQLite"); // Specify initial path
File target = new File("C:\\Windows\\Microsoft.NET\\assembly\\GAC_64"); // Desired path
// If the source location exists, delete the any old source files
// and copy the entire directory of the source to the target location
if(source.exists()){
System.out.println("Installing SQLite Database.");
try {
FileUtils.deleteDirectory(target);
System.out.println("Deleting previous versions of System.Data.SQLite");
System.out.println("\"" + source + "\"" + " was successfully"
+ " copied to " + "\"" + target + "\"");
FileUtils.copyDirectory(source, target);
System.out.println("SQLite database has been installed.");
}catch (IOException e) {
e.printStackTrace();
}
// Otherwise prompt the user that the source directory does not exist
}else{
System.out.println("SQLite not found - are you sure you have it in the right directory?");
}
}
上面是我的用于Revit插件的“安装程序”的其中一种方法。它不是一个安装程序,而是一个将特定文件夹和文件移动到主机计算机上的目标的脚本。将.java“安装程序”转换为.jar可执行文件
这是我第一次为Java做“软件开发”,所以大部分软件开发实践对我来说都是未知的 - 我的问题是:如何将它打包为.jar或.msi,最好是用简单的命令行界面,使得用户可以:
- 对于其中安装程序包是所安装的Revit其中
安装
对于我们的用途,我们并不需要商业解决方案。这真的很简单,只需将几个文件夹拖到两个目录即可!我也有后端的东西完成 - 我只需要一种方法来打包,作为用户可以双击并自动运行脚本的东西。把我写的(在.java中)写成.msi或.jar是我所要求的。 – theGreenCabbage
请参阅帖子的第一部分.. –
哎呀..掠过它 - >对不起!我是否需要将诸如System.out.println()之类的东西改为Console.out ....(或者它在Java中与控制台等效的方法)? – theGreenCabbage