Skip to content

Commit cc1719e

Browse files
Added commentary to setup script
1 parent 2062c16 commit cc1719e

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

CalibreImport/Setup.ps1

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ function Unregister-Dll {
6464
}
6565
}
6666

67+
# full list of Calibre-supported extensions from the registry
6768
function GetCalibreExtensions {
6869
$calibreAssocKey = "HKCU:\SOFTWARE\calibre\calibre64bit\Capabilities\FileAssociations"
6970
if (Test-Path $calibreAssocKey) {
@@ -75,6 +76,8 @@ function GetCalibreExtensions {
7576
}
7677
}
7778

79+
<# adding registry entries for all Calibre-supported extensions
80+
this is redundant, since the C# code already takes care of this upon registration #>
7881
function Add-RegistryEntries {
7982
$extensions = GetCalibreExtensions
8083
$guid = "8E5CD5CA-64E0-479A-B62F-B1FC00FF0227"
@@ -89,6 +92,8 @@ function Add-RegistryEntries {
8992
}
9093
}
9194

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

@@ -101,12 +106,14 @@ function Remove-RegistryEntries {
101106
}
102107
}
103108

109+
# optional
104110
function Restart-Explorer {
105111
Stop-Process -Name explorer -Force
106112
Start-Process explorer
107113
Log "Explorer restarted"
108114
}
109115

116+
# verify whether the dll registration went through successfully
110117
function Check-DllRegistration {
111118
param (
112119
[string]$dllPath
@@ -134,6 +141,7 @@ if (-not $dllFiles) {
134141
throw "No DLLs found in the script directory."
135142
}
136143

144+
# main script logic
137145
if ($i -or (-not $u -and -not $re)) {
138146
foreach ($dllFile in $dllFiles) {
139147
$dllPath = $dllFile.FullName

0 commit comments

Comments
 (0)