Skip to content

Commit

Permalink
Added to the MSI installer a property to set the default PDF version …
Browse files Browse the repository at this point in the history
…in the settings panel combo box
  • Loading branch information
torakiki committed Oct 25, 2024
1 parent b97bf1c commit e8e9496
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
9 changes: 8 additions & 1 deletion pdfsam-basic/src/msi/CA/AddLine/AddLine/CustomAction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,20 @@ public static ActionResult AddLine(Session session)
File.AppendAllText(path, "java-options=-Dorg.pdfsam.default.fetch.premium.modules=" + session.CustomActionData["premium"] + Environment.NewLine);
File.AppendAllText(path, "java-options=-Dorg.pdfsam.default.compression=" + session.CustomActionData["compression"] + Environment.NewLine);
File.AppendAllText(path, "java-options=-Dorg.pdfsam.default.output.overwrite=" + session.CustomActionData["overwrite"] + Environment.NewLine);
if (session.CustomActionData.ContainsKey("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);
}
}
if (session.CustomActionData.ContainsKey("pdfversion")) {
string pdfversion = session.CustomActionData["pdfversion"];
if (!string.IsNullOrEmpty(pdfversion))
{
File.AppendAllText(path, "java-options=-Dorg.pdfsam.default.pdf.version=" + pdfversion + Environment.NewLine);
}
}
}
else
{
Expand Down
2 changes: 1 addition & 1 deletion pdfsam-basic/src/msi/SignDll.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ ECHO OFF

IF NOT EXIST "AddLine.CA.dll" GOTO error
attrib -r "AddLine.CA.dll"
"signtool.exe" sign /v /debug /fd sha256 /td sha256 /tr http://sha256timestamp.ws.symantec.com/sha256/timestamp /sha1 "%SIGN_CERT_FINGERPRINT%" "AddLine.CA.dll"
"signtool.exe" sign /v /debug /fd sha256 /td sha256 /tr http://timestamp.sectigo.com /sha1 "%SIGN_CERT_FINGERPRINT%" "AddLine.CA.dll"
if %ERRORLEVEL% NEQ 0 goto error
ECHO "Dll signed"

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 @@ -22,10 +22,11 @@
<Property Id="PDF_COMPRESSION" Value="true" Secure="yes"/>
<Property Id="OVERWRITE_OUTPUT" Value="false" Secure="yes"/>
<Property Id="PREFIX" Secure="yes"/>
<Property Id="PDF_VERSION" 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];prefix=[PREFIX]" />
<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];pdfversion=[PDF_VERSION]" />
<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 e8e9496

Please sign in to comment.