-
-
Notifications
You must be signed in to change notification settings - Fork 29
Expand file tree
/
Copy pathpaperback.iss.in
More file actions
147 lines (137 loc) · 9.81 KB
/
Copy pathpaperback.iss.in
File metadata and controls
147 lines (137 loc) · 9.81 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
[Setup]
AppName=Paperback
AppVersion=@PROJECT_VERSION@
AppPublisher=Quin Gillespie
AppPublisherURL=https://github.com/trypsynth/paperback
AppSupportURL=https://github.com/trypsynth/paperback/issues
AppUpdatesURL=https://github.com/trypsynth/paperback/releases
DefaultDirName={autopf}\Paperback
DisableProgramGroupPage=yes
DisableDirPage=yes
LicenseFile=
OutputDir=.
OutputBaseFilename=paperback_setup
Compression=lzma2
SolidCompression=yes
WizardStyle=modern
UninstallDisplayIcon={app}\paperback.exe
ArchitecturesInstallIn64BitMode=x64compatible
[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"
[Files]
Source: "paperback.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "pb.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "pdfium.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "sounds\*"; DestDir: "{app}\sounds"; Flags: ignoreversion recursesubdirs createallsubdirs
[InstallDelete]
Type: files; Name: "{app}\nvdaControllerClient64.dll"
Type: files; Name: "{app}\SAAPI64.dll"
Type: filesandordirs; Name: "{app}\langs"
Type: files; Name: "{app}\readme.html"
[Tasks]
Name: "desktopicon"; Description: "Desktop Shortcut"
Name: "startmenuicon"; Description: "Start Menu Shortcut"; Flags: unchecked
Name: "addtopath"; Description: "Add Paperback directory to PATH"; Flags: unchecked
Name: "assoc_chm"; Description: "Associate with Compiled HTML Help files (*.chm)"; Flags: unchecked
Name: "assoc_word"; Description: "Associate with Word Documents (*.doc, *.docx, *.docm)"; Flags: unchecked
Name: "assoc_epub"; Description: "Associate with Epub Books (*.epub)"
Name: "assoc_fb2"; Description: "Associate with FB2 Books (*.fb2)"; Flags: unchecked
Name: "assoc_html"; Description: "Associate with HTML Documents (*.htm, *.html, *.xhtml)"; Flags: unchecked
Name: "assoc_markdown"; Description: "Associate with Markdown Documents (*.md, *.markdown, *.mdx, *.mdown, *.mdwn, *.mkd, *.mkdn, *.mkdown, *.ronn)"; Flags: unchecked
Name: "assoc_mobi"; Description: "Associate with Kindle Books (*.mobi)"; Flags: unchecked
Name: "assoc_odp"; Description: "Associate with OpenDocument presentations (*.odp, *.fodp)"; Flags: unchecked
Name: "assoc_odt"; Description: "Associate with OpenDocument text files (*.odt, *.fodt)"; Flags: unchecked
Name: "assoc_pdf"; Description: "Associate with PDF Documents (*.pdf)"
Name: "assoc_powerpoint"; Description: "Associate with PowerPoint Presentations (*.pptx, *.pptm, *.ppt)"; Flags: unchecked
Name: "assoc_rtf"; Description: "Associate with RTF files (*.rtf)"
Name: "assoc_text"; Description: "Associate with Text Files (*.txt, *.log)"; Flags: unchecked
Name: "assoc_xml"; Description: "Associate with XML documents (*.xml)"; Flags: unchecked
Name: "assoc_zip"; Description: "Associate with ZIP archives (*.zip)"; Flags: unchecked
[Icons]
Name: "{autodesktop}\Paperback"; Filename: "{app}\paperback.exe"; Tasks: desktopicon
Name: "{autoprograms}\Paperback"; Filename: "{app}\paperback.exe"; Tasks: startmenuicon
[Registry]
; Core Paperback.Document class registration.
Root: HKCR; Subkey: "Paperback.Document"; ValueType: string; ValueName: ""; ValueData: "Paperback Document"; Flags: uninsdeletekey
Root: HKCR; Subkey: "Paperback.Document\DefaultIcon"; ValueType: string; ValueName: ""; ValueData: "{app}\paperback.exe,0"
Root: HKCR; Subkey: "Paperback.Document\shell\open\command"; ValueType: string; ValueName: ""; ValueData: """{app}\paperback.exe"" ""%1"""
; Compiled HTML Help files.
Root: HKCR; Subkey: ".chm\OpenWithProgids"; ValueType: string; ValueName: "Paperback.Document"; ValueData: ""; Flags: uninsdeletevalue; Tasks: assoc_chm
; Word Documents.
Root: HKCR; Subkey: ".doc\OpenWithProgids"; ValueType: string; ValueName: "Paperback.Document"; ValueData: ""; Flags: uninsdeletevalue; Tasks: assoc_word
Root: HKCR; Subkey: ".docx\OpenWithProgids"; ValueType: string; ValueName: "Paperback.Document"; ValueData: ""; Flags: uninsdeletevalue; Tasks: assoc_word
Root: HKCR; Subkey: ".docm\OpenWithProgids"; ValueType: string; ValueName: "Paperback.Document"; ValueData: ""; Flags: uninsdeletevalue; Tasks: assoc_word
; Epub Books.
Root: HKCR; Subkey: ".epub"; ValueType: string; ValueName: ""; ValueData: "Paperback.Document"; Flags: uninsdeletevalue; Tasks: assoc_epub
; FB2 Books.
Root: HKCR; Subkey: ".fb2"; ValueType: string; ValueName: ""; ValueData: "Paperback.Document"; Flags: uninsdeletevalue; Tasks: assoc_fb2
; HTML Documents.
Root: HKCR; Subkey: ".htm\OpenWithProgids"; ValueType: string; ValueName: "Paperback.Document"; ValueData: ""; Flags: uninsdeletevalue; Tasks: assoc_html
Root: HKCR; Subkey: ".html\OpenWithProgids"; ValueType: string; ValueName: "Paperback.Document"; ValueData: ""; Flags: uninsdeletevalue; Tasks: assoc_html
Root: HKCR; Subkey: ".xhtml\OpenWithProgids"; ValueType: string; ValueName: "Paperback.Document"; ValueData: ""; Flags: uninsdeletevalue; Tasks: assoc_html
; Markdown Documents.
Root: HKCR; Subkey: ".markdown\OpenWithProgids"; ValueType: string; ValueName: "Paperback.Document"; ValueData: ""; Flags: uninsdeletevalue; Tasks: assoc_markdown
Root: HKCR; Subkey: ".md\OpenWithProgids"; ValueType: string; ValueName: "Paperback.Document"; ValueData: ""; Flags: uninsdeletevalue; Tasks: assoc_markdown
Root: HKCR; Subkey: ".mdown\OpenWithProgids"; ValueType: string; ValueName: "Paperback.Document"; ValueData: ""; Flags: uninsdeletevalue; Tasks: assoc_markdown
Root: HKCR; Subkey: ".mdwn\OpenWithProgids"; ValueType: string; ValueName: "Paperback.Document"; ValueData: ""; Flags: uninsdeletevalue; Tasks: assoc_markdown
Root: HKCR; Subkey: ".mdx\OpenWithProgids"; ValueType: string; ValueName: "Paperback.Document"; ValueData: ""; Flags: uninsdeletevalue; Tasks: assoc_markdown
Root: HKCR; Subkey: ".mkd\OpenWithProgids"; ValueType: string; ValueName: "Paperback.Document"; ValueData: ""; Flags: uninsdeletevalue; Tasks: assoc_markdown
Root: HKCR; Subkey: ".mkdn\OpenWithProgids"; ValueType: string; ValueName: "Paperback.Document"; ValueData: ""; Flags: uninsdeletevalue; Tasks: assoc_markdown
Root: HKCR; Subkey: ".mkdown\OpenWithProgids"; ValueType: string; ValueName: "Paperback.Document"; ValueData: ""; Flags: uninsdeletevalue; Tasks: assoc_markdown
Root: HKCR; Subkey: ".ronn\OpenWithProgids"; ValueType: string; ValueName: "Paperback.Document"; ValueData: ""; Flags: uninsdeletevalue; Tasks: assoc_markdown
; Kindle Books.
Root: HKCR; Subkey: ".mobi\OpenWithProgids"; ValueType: string; ValueName: "Paperback.Document"; ValueData: ""; Flags: uninsdeletevalue; Tasks: assoc_mobi
; OpenDocument presentation files.
Root: HKCR; Subkey: ".odp\OpenWithProgids"; ValueType: string; ValueName: "Paperback.Document"; ValueData: ""; Flags: uninsdeletevalue; Tasks: assoc_odp
Root: HKCR; Subkey: ".fodp\OpenWithProgids"; ValueType: string; ValueName: "Paperback.Document"; ValueData: ""; Flags: uninsdeletevalue; Tasks: assoc_odp
; OpenDocument text files.
Root: HKCR; Subkey: ".odt\OpenWithProgids"; ValueType: string; ValueName: "Paperback.Document"; ValueData: ""; Flags: uninsdeletevalue; Tasks: assoc_odt
Root: HKCR; Subkey: ".fodt\OpenWithProgids"; ValueType: string; ValueName: "Paperback.Document"; ValueData: ""; Flags: uninsdeletevalue; Tasks: assoc_odt
; PDF Documents.
Root: HKCR; Subkey: ".pdf\OpenWithProgids"; ValueType: string; ValueName: "Paperback.Document"; ValueData: ""; Flags: uninsdeletevalue; Tasks: assoc_pdf
; PowerPoint Presentations.
Root: HKCR; Subkey: ".pptx\OpenWithProgids"; ValueType: string; ValueName: "Paperback.Document"; ValueData: ""; Flags: uninsdeletevalue; Tasks: assoc_powerpoint
Root: HKCR; Subkey: ".pptm\OpenWithProgids"; ValueType: string; ValueName: "Paperback.Document"; ValueData: ""; Flags: uninsdeletevalue; Tasks: assoc_powerpoint
Root: HKCR; Subkey: ".ppt\OpenWithProgids"; ValueType: string; ValueName: "Paperback.Document"; ValueData: ""; Flags: uninsdeletevalue; Tasks: assoc_powerpoint
; RTF files.
Root: HKCR; Subkey: ".rtf\OpenWithProgids"; ValueType: string; ValueName: "Paperback.Document"; ValueData: ""; Flags: uninsdeletevalue; Tasks: assoc_rtf
; Text Files.
Root: HKCR; Subkey: ".log\OpenWithProgids"; ValueType: string; ValueName: "Paperback.Document"; ValueData: ""; Flags: uninsdeletevalue; Tasks: assoc_text
Root: HKCR; Subkey: ".txt\OpenWithProgids"; ValueType: string; ValueName: "Paperback.Document"; ValueData: ""; Flags: uninsdeletevalue; Tasks: assoc_text
; ZIP archives.
Root: HKCR; Subkey: ".zip\OpenWithProgids"; ValueType: string; ValueName: "Paperback.Document"; ValueData: ""; Flags: uninsdeletevalue; Tasks: assoc_zip
; PATH. Appended only when not already present; removed cleanly on uninstall via [Code].
Root: HKLM; Subkey: "SYSTEM\CurrentControlSet\Control\Session Manager\Environment"; ValueType: expandsz; ValueName: "Path"; ValueData: "{olddata};{app}"; Flags: preservestringtype; Check: NeedsAddPath; Tasks: addtopath
[Code]
const
PathSubkey = 'SYSTEM\CurrentControlSet\Control\Session Manager\Environment';
function NeedsAddPath: Boolean;
var
CurrentPath: string;
begin
if not RegQueryStringValue(HKLM, PathSubkey, 'Path', CurrentPath) then CurrentPath := '';
Result := Pos(';' + ExpandConstant('{app}'), ';' + CurrentPath) = 0;
end;
procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep);
var
CurrentPath, AppDir, NewPath: string;
P: Integer;
begin
if CurUninstallStep <> usPostUninstall then Exit;
if not RegQueryStringValue(HKLM, PathSubkey, 'Path', CurrentPath) then Exit;
AppDir := ExpandConstant('{app}');
P := Pos(';' + AppDir, CurrentPath);
if P > 0 then
NewPath := Copy(CurrentPath, 1, P - 1) + Copy(CurrentPath, P + 1 + Length(AppDir), MaxInt)
else
begin
P := Pos(AppDir + ';', CurrentPath);
if P > 0 then
NewPath := Copy(CurrentPath, 1, P - 1) + Copy(CurrentPath, P + Length(AppDir) + 1, MaxInt)
else
Exit;
end;
RegWriteExpandStringValue(HKLM, PathSubkey, 'Path', NewPath);
end;
[Run]
Filename: "{app}\paperback.exe"; Description: "Launch Paperback"; Flags: nowait postinstall skipifsilent