Skip to content

Commit f35fc40

Browse files
still trying to get auto-release to work
1 parent cc1719e commit f35fc40

File tree

5 files changed

+13
-2
lines changed

5 files changed

+13
-2
lines changed

CalibreImport/CalibreContextMenuExtension.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ namespace CalibreImport
2020
{
2121
//[ComVisible(true)]
2222
[ClassInterface(ClassInterfaceType.None)]
23-
[Guid("8E5CD5CA-64E0-479A-B62F-B1FC00FF0227"), ComVisible(true)]
23+
[Guid("8E5CD5CA-64E0-479A-B62F-B1FC00FF0227"), ComVisible(true)] // not sure which ComVisible is better
2424
[DisplayName("Calibre Import Shell Extension")]
2525
[COMServerAssociation(AssociationType.AllFiles)] //needed for Directory Opus, apparently.
2626
[COMServerAssociation(AssociationType.ClassOfExtension, ".epub", ".pdf", ".mobi", ".azw", ".azw3", ".fb2", ".djvu", ".lrf", ".rtf", ".txt", ".doc", ".docx", ".odt", ".htm", ".html", ".cbz", ".cbr", ".pdb", ".snb", ".tcr", ".zip", ".rar")]
0 Bytes
Binary file not shown.
-191 Bytes
Binary file not shown.

CalibreImport/ReleaseFiles/Setup.ps1

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<# CalibreImportShellExtension Setup file.
2-
This script registers all DLL files in the directory as context menu handlers for various file extensions.
2+
This script registers all CalibreImport Shell Extension DLL files;
3+
Registration creates context menu handlers for Calibre file extensions.
34
The script can be run with the following arguments:
45
-i: Register the DLLs and add registry entries.
56
-u: Unregister the DLLs and remove registry entries.
@@ -13,6 +14,7 @@ param (
1314
[switch]$re
1415
)
1516

17+
# variables
1618
$scriptPath = $MyInvocation.MyCommand.Path
1719
$scriptDir = Split-Path -Parent $scriptPath
1820
$logFilePath = Join-Path $scriptDir "SetupLog.txt"
@@ -63,6 +65,7 @@ function Unregister-Dll {
6365
}
6466
}
6567

68+
# full list of Calibre-supported extensions from the registry
6669
function GetCalibreExtensions {
6770
$calibreAssocKey = "HKCU:\SOFTWARE\calibre\calibre64bit\Capabilities\FileAssociations"
6871
if (Test-Path $calibreAssocKey) {
@@ -74,6 +77,8 @@ function GetCalibreExtensions {
7477
}
7578
}
7679

80+
<# adding registry entries for all Calibre-supported extensions
81+
this is redundant, since the C# code already takes care of this upon registration #>
7782
function Add-RegistryEntries {
7883
$extensions = GetCalibreExtensions
7984
$guid = "8E5CD5CA-64E0-479A-B62F-B1FC00FF0227"
@@ -88,6 +93,8 @@ function Add-RegistryEntries {
8893
}
8994
}
9095

96+
<# removing registry entries for all Calibre-supported extensions
97+
this is redundant, since the C# code already takes care of this upon unregistration #>
9198
function Remove-RegistryEntries {
9299
$extensions = GetCalibreExtensions
93100

@@ -100,12 +107,14 @@ function Remove-RegistryEntries {
100107
}
101108
}
102109

110+
# optional
103111
function Restart-Explorer {
104112
Stop-Process -Name explorer -Force
105113
Start-Process explorer
106114
Log "Explorer restarted"
107115
}
108116

117+
# verify whether the dll registration went through successfully
109118
function Check-DllRegistration {
110119
param (
111120
[string]$dllPath
@@ -133,6 +142,7 @@ if (-not $dllFiles) {
133142
throw "No DLLs found in the script directory."
134143
}
135144

145+
# main script logic
136146
if ($i -or (-not $u -and -not $re)) {
137147
foreach ($dllFile in $dllFiles) {
138148
$dllPath = $dllFile.FullName

CalibreImport/Setup.ps1

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ param (
1414
[switch]$re
1515
)
1616

17+
# variables
1718
$scriptPath = $MyInvocation.MyCommand.Path
1819
$scriptDir = Split-Path -Parent $scriptPath
1920
$logFilePath = Join-Path $scriptDir "SetupLog.txt"

0 commit comments

Comments
 (0)