Inno Setup 5 を使用し{app}
て、宛先としてini ファイルを作成します。
[INI]
Filename: "{userdocs}\JavaCppDemo.ini"; Section: "InstallSettings"; Flags: uninsdeletesection
Filename: "{userdocs}\JavaCppDemo.ini"; Section: "InstallSettings"; Key: "InstallPath"; String: "{app}"
次に、ini4j を使用して InstallPath の値を取得します。
String DefaultFolder = new FileChooser().getFileSystemView().getDefaultDirectory().toString();
// tricky way of getting at user/documents folder
String strFileName = DefaultFolder + "\\JavaCppDemo.ini";
Ini ini = null;
try {
ini = new Ini(new File(DefaultFolder + "\\JavaCppDemo.ini"));
} catch (IOException ex) {
Logger.getLogger(CppInterface.class.getName()).log(Level.SEVERE, null, ex);
}
String strDatafile;
Ini.Section section = ini.get("InstallSettings");
String installPath = section.get("InstallPath");
問題の installPath が に設定されC:UsersEd SowellDocumentsJavaCppDemoLog.txt
ます。
IOW、パス要素セパレーター\
が取り除かれます。
の値は{app}
、セットアップの実行時に FileChooser でユーザーが選択するため、変更するオプションはありません。
これは、Inno-Setup と ini4j の間の既知の非互換性ですか?