From 01a2adbe9afb4200d80c780890ec46598fc3cdff Mon Sep 17 00:00:00 2001 From: torakiki Date: Fri, 27 Oct 2023 16:03:39 +0200 Subject: [PATCH] ref #538: MSI property to allow default PREFIX configuration --- pdfsam-basic/src/msi/CA/AddLine/AddLine/CustomAction.cs | 8 +++++++- pdfsam-basic/src/msi/pdfsam.wxs | 3 ++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/pdfsam-basic/src/msi/CA/AddLine/AddLine/CustomAction.cs b/pdfsam-basic/src/msi/CA/AddLine/AddLine/CustomAction.cs index 1a56d1648..b8d715dfb 100755 --- a/pdfsam-basic/src/msi/CA/AddLine/AddLine/CustomAction.cs +++ b/pdfsam-basic/src/msi/CA/AddLine/AddLine/CustomAction.cs @@ -29,7 +29,13 @@ public static ActionResult AddLine(Session session) File.AppendAllText(path, "java-options=-Dorg.pdfsam.default.compression=" + session.CustomActionData["compression"] + Environment.NewLine); session.Log("Added -Dorg.pdfsam.default.compression=" + session.CustomActionData["compression"]); File.AppendAllText(path, "java-options=-Dorg.pdfsam.default.output.overwrite=" + session.CustomActionData["overwrite"] + Environment.NewLine); - session.Log("Added -Dorg.pdfsam.default.output.overwrite=" + session.CustomActionData["overwrite"]); + session.Log("Added -Dorg.pdfsam.default.output.overwrite=" + session.CustomActionData["overwrite"]); + string prefix = session["PREFIX"]; + if (!string.IsNullOrEmpty(prefix)) + { + File.AppendAllText(path, "java-options=-Dorg.pdfsam.default.prefix=\"" + prefix + "\"" + Environment.NewLine); + session.Log("Added -Dorg.pdfsam.default.prefix=" + prefix); + } }else { session.Log("Unable to find config file"); diff --git a/pdfsam-basic/src/msi/pdfsam.wxs b/pdfsam-basic/src/msi/pdfsam.wxs index 5f44f600c..6527d8e1f 100644 --- a/pdfsam-basic/src/msi/pdfsam.wxs +++ b/pdfsam-basic/src/msi/pdfsam.wxs @@ -21,10 +21,11 @@ + - +