Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 66695f595f | |||
| cd64c19fa3 | |||
| 70cc9583af | |||
| a1c79ab1f3 | |||
| d0a9bc9055 | |||
| 006228647d | |||
| af2f15fd40 | |||
| 065df71090 | |||
| a17d288f92 |
@@ -37,7 +37,7 @@ namespace PDF_Merge
|
|||||||
return titleAttribute.Title;
|
return titleAttribute.Title;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return Path.GetFileNameWithoutExtension(Assembly.GetExecutingAssembly().CodeBase);
|
return Path.GetFileNameWithoutExtension(Assembly.GetExecutingAssembly().Location);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -45,7 +45,7 @@ namespace PDF_Merge
|
|||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
return Assembly.GetExecutingAssembly().GetName().Version.ToString();
|
return Assembly.GetExecutingAssembly()?.GetName()?.Version?.ToString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
10
ConfForm.cs
10
ConfForm.cs
@@ -17,11 +17,11 @@ namespace PDF_Merge
|
|||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
|
|
||||||
string sourcePath = ConfigurationManager.AppSettings["PDF-Path"];
|
string sourcePath = ConfigurationManager.AppSettings["PDF-Path"] ?? "";
|
||||||
string outputPath = ConfigurationManager.AppSettings["PDF-Output"];
|
string outputPath = ConfigurationManager.AppSettings["PDF-Output"] ?? "";
|
||||||
string outputName = ConfigurationManager.AppSettings["PDF-Name"];
|
string outputName = ConfigurationManager.AppSettings["PDF-Name"] ?? "merged";
|
||||||
string outputExt = ConfigurationManager.AppSettings["PDF-Extension"];
|
string outputExt = ConfigurationManager.AppSettings["PDF-Extension"] ?? ".pdf";
|
||||||
string dateIndex = ConfigurationManager.AppSettings["dateIndex"];
|
string dateIndex = ConfigurationManager.AppSettings["dateIndex"] ?? "0";
|
||||||
|
|
||||||
int dateIndexValue;
|
int dateIndexValue;
|
||||||
|
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ namespace PDF_Merge
|
|||||||
}
|
}
|
||||||
public void SetPathLable()
|
public void SetPathLable()
|
||||||
{
|
{
|
||||||
string sourcePath = ConfigurationManager.AppSettings["PDF-Path"];
|
string sourcePath = ConfigurationManager.AppSettings["PDF-Path"] ?? "";
|
||||||
|
|
||||||
if (sourcePath != null)
|
if (sourcePath != null)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -60,7 +60,7 @@
|
|||||||
}
|
}
|
||||||
public static string[] CollectPdfFiles()
|
public static string[] CollectPdfFiles()
|
||||||
{
|
{
|
||||||
string dirPath = ConfigurationManager.AppSettings["PDF-Path"];
|
string dirPath = ConfigurationManager.AppSettings["PDF-Path"] ?? "";
|
||||||
Console.WriteLine(dirPath);
|
Console.WriteLine(dirPath);
|
||||||
string[] pdfFiles = Directory.EnumerateFiles(dirPath, "*.pdf").ToArray();
|
string[] pdfFiles = Directory.EnumerateFiles(dirPath, "*.pdf").ToArray();
|
||||||
Array.Sort(pdfFiles);
|
Array.Sort(pdfFiles);
|
||||||
@@ -81,7 +81,7 @@
|
|||||||
public static string GetDate()
|
public static string GetDate()
|
||||||
{
|
{
|
||||||
DateTime date = DateTime.Now;
|
DateTime date = DateTime.Now;
|
||||||
string dateFormat = ConfigurationManager.AppSettings["dateFormat"];
|
string dateFormat = ConfigurationManager.AppSettings["dateFormat"] ?? "yyyy-MM-dd";
|
||||||
return date.ToString(dateFormat);
|
return date.ToString(dateFormat);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -34,7 +34,23 @@ SectionGroup "PDF-Merge" pdf_merge_inst
|
|||||||
File "bin\Release\PDF-Merge.zip"
|
File "bin\Release\PDF-Merge.zip"
|
||||||
nsisunz::UnzipToLog "$INSTDIR\PDF-Merge.zip" "$INSTDIR"
|
nsisunz::UnzipToLog "$INSTDIR\PDF-Merge.zip" "$INSTDIR"
|
||||||
Delete "$INSTDIR\PDF-Merge.zip"
|
Delete "$INSTDIR\PDF-Merge.zip"
|
||||||
|
nsExec::ExecToStack 'icacls "$INSTDIR" /grant Everyone:F /T'
|
||||||
CreateShortCut "$DESKTOP\PDF-Merge.lnk" "${APP_EXE}"
|
CreateShortCut "$DESKTOP\PDF-Merge.lnk" "${APP_EXE}"
|
||||||
|
File "PDF-Merge Icon.ico"
|
||||||
|
; Write the registry keys to add the program to the Installed Programs list
|
||||||
|
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\PDF-Merge\" "InstallDate" 0x00000000
|
||||||
|
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\PDF-Merge\" "DisplayName" "PDF-Merge"
|
||||||
|
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\PDF-Merge\" "DisplayVersion" "$Current_Version"
|
||||||
|
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\PDF-Merge\" "Publisher" "$Company_Name"
|
||||||
|
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\PDF-Merge\" "UninstallString" '"$INSTDIR\uninst.exe"'
|
||||||
|
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\PDF-Merge\" "DisplayIcon" '"$INSTDIR\PDF-Merge Icon.ico"'
|
||||||
|
|
||||||
|
WriteUninstaller "uninst.exe"
|
||||||
SectionEnd
|
SectionEnd
|
||||||
SectionGroupEnd
|
SectionGroupEnd
|
||||||
|
|
||||||
|
Section "Uninstall"
|
||||||
|
Delete "$DESKTOP\PDF-Merge.lnk"
|
||||||
|
DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\PDF-Merge\"
|
||||||
|
RMDir /r "$INSTDIR"
|
||||||
|
SectionEnd
|
||||||
|
|||||||
Reference in New Issue
Block a user