Skip to content

Commit

Permalink
ref #538: MSI property to allow default PREFIX configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
torakiki committed Oct 27, 2023
1 parent a90a646 commit 01a2adb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
8 changes: 7 additions & 1 deletion pdfsam-basic/src/msi/CA/AddLine/AddLine/CustomAction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
3 changes: 2 additions & 1 deletion pdfsam-basic/src/msi/pdfsam.wxs
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,11 @@
<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"/>

<Icon Id="pdfsam.ico" SourceFile="$(var.ProductIcon)" />
<Binary Id="AddLine.dll" SourceFile="AddLine.CA.dll" />
<CustomAction Id="SetCustomActionDataValue" Return="check" Property="CustomActions.AddLine" Value="locale=[LOCALE_CODE];updates=[CHECK_FOR_UPDATES];sounds=[PLAY_SOUNDS];news=[CHECK_FOR_NEWS];premium=[PREMIUM_MODULES];donate=[DONATE_NOTIFICATION];folder=[APPLICATIONFOLDER];compression=[PDF_COMPRESSION];overwrite=[OVERWRITE_OUTPUT]" />
<CustomAction Id="SetCustomActionDataValue" Return="check" Property="CustomActions.AddLine" Value="locale=[LOCALE_CODE];updates=[CHECK_FOR_UPDATES];sounds=[PLAY_SOUNDS];news=[CHECK_FOR_NEWS];premium=[PREMIUM_MODULES];donate=[DONATE_NOTIFICATION];folder=[APPLICATIONFOLDER];compression=[PDF_COMPRESSION];overwrite=[OVERWRITE_OUTPUT];prefix=[PREFIX]" />
<CustomAction Id="CustomActions.AddLine" Return="check" Execute="deferred" BinaryKey="AddLine.dll" DllEntry="AddLine" Impersonate="no"/>

<MajorUpgrade DowngradeErrorMessage="A newer version of PDFsam Basic is already installed. Setup will now exit." />
Expand Down

0 comments on commit 01a2adb

Please sign in to comment.