Skip to content

Commit

Permalink
ref #538: default prefix can be configured as an MSI property
Browse files Browse the repository at this point in the history
  • Loading branch information
torakiki committed Nov 6, 2023
1 parent eb8349d commit 041c198
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
Binary file modified pdfsam-basic/src/msi/AddLine.CA.dll
Binary file not shown.
18 changes: 11 additions & 7 deletions pdfsam-basic/src/msi/CA/AddLine/AddLine/CustomAction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,21 @@ public static ActionResult AddLine(Session session)
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"]);
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);
if (session.CustomActionData.ContainsKey("prefix")) {
string prefix = session.CustomActionData["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
}
else
{
session.Log("Unable to find config file");
}
}catch (Exception){
}catch (Exception e){
session.Log($"Exception: {e.Message}");
return ActionResult.Failure;
}
return ActionResult.Success;
Expand Down
2 changes: 1 addition & 1 deletion pdfsam-basic/src/msi/pdfsam.wxs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<Property Id="PREMIUM_MODULES" Value="true" Secure="yes"/>
<Property Id="PDF_COMPRESSION" Value="true" Secure="yes"/>
<Property Id="OVERWRITE_OUTPUT" Value="false" Secure="yes"/>
<Property Id="PREFIX" Value="" Secure="yes"/>
<Property Id="PREFIX" Secure="yes"/>

<Icon Id="pdfsam.ico" SourceFile="$(var.ProductIcon)" />
<Binary Id="AddLine.dll" SourceFile="AddLine.CA.dll" />
Expand Down

0 comments on commit 041c198

Please sign in to comment.