@@ -191,23 +191,28 @@ Begin
191
191
function SetRoot
192
192
{
193
193
WriteTitle ' Root'
194
- $0 = (EnsurePath ' Registry::HKEY_CLASSES_ROOT\River.OneMoreAddIn' )
194
+ $0 = ' Registry::HKEY_CLASSES_ROOT\River.OneMoreAddIn'
195
+ EnsurePath $0
195
196
Set-ItemProperty $0 - Name ' (Default)' - Type String - Value ' River.OneMoreAddIn.AddIn'
196
197
WriteOK $0
197
198
198
- $0 = (EnsurePath ' Registry::HKEY_CLASSES_ROOT\River.OneMoreAddIn\CLSID' )
199
+ $0 = ' Registry::HKEY_CLASSES_ROOT\River.OneMoreAddIn\CLSID'
200
+ EnsurePath $0
199
201
Set-ItemProperty $0 - Name ' (Default)' - Type String - Value $guid
200
202
WriteOK $0
201
203
202
- $0 = (EnsurePath ' Registry::HKEY_CLASSES_ROOT\River.OneMoreAddIn\CurVer' )
204
+ $0 = ' Registry::HKEY_CLASSES_ROOT\River.OneMoreAddIn\CurVer'
205
+ EnsurePath $0
203
206
Set-ItemProperty $0 - Name ' (Default)' - Type String - Value ' River.OneMoreAddIn.1'
204
207
WriteOK $0
205
208
206
- $0 = (EnsurePath ' Registry::HKEY_CLASSES_ROOT\River.OneMoreAddIn.1' )
209
+ $0 = ' Registry::HKEY_CLASSES_ROOT\River.OneMoreAddIn.1'
210
+ EnsurePath $0
207
211
Set-ItemProperty $0 - Name ' (Default)' - Type String - Value ' Addin class'
208
212
WriteOK $0
209
213
210
- $0 = (EnsurePath ' Registry::HKEY_CLASSES_ROOT\River.OneMoreAddIn.1\CLSID' )
214
+ $0 = ' Registry::HKEY_CLASSES_ROOT\River.OneMoreAddIn.1\CLSID'
215
+ EnsurePath $0
211
216
Set-ItemProperty $0 - Name ' (Default)' - Type String - Value $guid
212
217
WriteOK $0
213
218
return $true
@@ -216,7 +221,8 @@ Begin
216
221
function SetAppID
217
222
{
218
223
WriteTitle ' AppID'
219
- $0 = (EnsurePath " Registry::HKEY_CLASSES_ROOT\AppID\$guid " )
224
+ $0 = ' Registry::HKEY_CLASSES_ROOT\River.OneMoreAddIn.1\CLSID'
225
+ EnsurePath $0
220
226
Set-ItemProperty $0 - Name ' DllSurrogate' - Type String - Value ' '
221
227
WriteOK $0
222
228
return $true
@@ -225,13 +231,15 @@ Begin
225
231
function SetProtocolHandler
226
232
{
227
233
WriteTitle ' Protocol handler'
228
- $0 = (EnsurePath ' Registry::HKEY_CLASSES_ROOT\onemore' )
234
+ $0 = ' Registry::HKEY_CLASSES_ROOT\onemore'
235
+ EnsurePath $0
229
236
Set-ItemProperty $0 - Name ' (Default)' - Type String - Value ' URL:OneMore Protocol Handler'
230
237
Set-ItemProperty $0 - Name ' URL Protocol' - Type String - Value ' '
231
238
WriteOK $0
232
239
233
240
# onemore:// protocol handler registration
234
- $0 = (EnsurePath ' Registry::HKEY_CLASSES_ROOT\onemore\shell\open\command' )
241
+ $0 = ' Registry::HKEY_CLASSES_ROOT\onemore\shell\open\command'
242
+ EnsurePath $0
235
243
Set-ItemProperty $0 - Name ' (Default)' - Type String - Value " `" $proto `" %1 %2 %3 %4 %5"
236
244
WriteOK $0
237
245
WriteValue " `" $proto `" %1 %2 %3 %4 %5"
@@ -259,15 +267,18 @@ Begin
259
267
return $false
260
268
}
261
269
262
- $0 = (EnsurePath " Registry::HKEY_CLASSES_ROOT\$clsid \$guid " )
270
+ $0 = " Registry::HKEY_CLASSES_ROOT\$clsid \$guid "
271
+ EnsurePath $0
263
272
Set-ItemProperty $0 - Name ' (Default)' - Type String - Value ' River.OneMoreAddIn.AddIn'
264
273
Set-ItemProperty $0 - Name ' AppID' - Type String - Value $guid
265
274
WriteOK $0
266
275
267
- $0 = (EnsurePath " Registry::HKEY_CLASSES_ROOT\$clsid \Implemented Categories\$catid " )
276
+ $0 = " Registry::HKEY_CLASSES_ROOT\$clsid \Implemented Categories\$catid "
277
+ EnsurePath $0
268
278
WriteOK $0
269
279
270
- $0 = (EnsurePath " Registry::HKEY_CLASSES_ROOT\$clsid \$guid \InprocServer32" )
280
+ $0 = " Registry::HKEY_CLASSES_ROOT\$clsid \$guid \InprocServer32"
281
+ EnsurePath $0
271
282
$asm = " River.OneMoreAddIn, Version=$pv , Culture=neutral, PublicKeyToken=null"
272
283
Set-ItemProperty $0 - Name ' (Default)' - Type String - Value ' mscoree.dll'
273
284
Set-ItemProperty $0 - Name ' Assembly' - Type String - Value $asm
@@ -277,7 +288,9 @@ Begin
277
288
Set-ItemProperty $0 - Name ' ThreadingModel' - Type String - Value ' Both'
278
289
WriteOK $0
279
290
280
- $0 = (EnsurePath " Registry::HKEY_CLASSES_ROOT\$clsid \$guid \InprocServer32\$pv " )
291
+ $0 = " Registry::HKEY_CLASSES_ROOT\$clsid \$guid \InprocServer32\$pv "
292
+ EnsurePath $0
293
+ write-host " [ $0 ]" - Fore DarkGray
281
294
$asm = " River.OneMoreAddIn, Version=$pv , Culture=neutral, PublicKeyToken=null"
282
295
Set-ItemProperty $0 - Name ' Assembly' - Type String - Value $asm
283
296
Set-ItemProperty $0 - Name ' Class' - Type String - Value ' River.OneMoreAddIn.AddIn'
@@ -286,19 +299,23 @@ Begin
286
299
WriteOK $0
287
300
WriteValue $addin
288
301
289
- $0 = (EnsurePath " Registry::HKEY_CLASSES_ROOT\$clsid \$guid \ProgID" )
302
+ $0 = " Registry::HKEY_CLASSES_ROOT\$clsid \$guid \ProgID"
303
+ EnsurePath $0
290
304
Set-ItemProperty $0 - Name ' (Default)' - Type String - Value ' River.OneMoreAddIn'
291
305
WriteOK $0
292
306
293
- $0 = (EnsurePath " Registry::HKEY_CLASSES_ROOT\$clsid \$guid \Programmable" )
307
+ $0 = " Registry::HKEY_CLASSES_ROOT\$clsid \$guid \Programmable"
308
+ EnsurePath $0
294
309
Set-ItemProperty $0 - Name ' (Default)' - Type String - Value ' '
295
310
WriteOK $0
296
311
297
- $0 = (EnsurePath " Registry::HKEY_CLASSES_ROOT\$clsid \$guid \TypeLib" )
312
+ $0 = " Registry::HKEY_CLASSES_ROOT\$clsid \$guid \TypeLib"
313
+ EnsurePath $0
298
314
Set-ItemProperty $0 - Name ' (Default)' - Type String - Value $guid
299
315
WriteOK $0
300
316
301
- $0 = (EnsurePath " Registry::HKEY_CLASSES_ROOT\$clsid \$guid \VersionIndependentProgID" )
317
+ $0 = " Registry::HKEY_CLASSES_ROOT\$clsid \$guid \VersionIndependentProgID"
318
+ EnsurePath $0
302
319
Set-ItemProperty $0 - Name ' (Default)' - Type String - Value ' River.OneMoreAddIn'
303
320
WriteOK $0
304
321
@@ -308,29 +325,33 @@ Begin
308
325
function SetUser
309
326
{
310
327
WriteTitle ' User'
311
- $0 = (EnsurePath " Registry::HKEY_CURRENT_USER\SOFTWARE\Classes\AppID\$guid " )
328
+ $0 = " Registry::HKEY_CURRENT_USER\SOFTWARE\Classes\AppID\$guid "
329
+ EnsurePath $0
312
330
Set-ItemProperty $0 - Name ' DllSurrogate' - Type String - Value ' '
313
331
WriteOK $0
314
332
315
- $0 = (EnsurePath ' Registry::HKEY_CURRENT_USER\SOFTWARE\Microsoft\Office\OneNote\AddIns\River.OneMoreAddIn' )
333
+ $0 = ' Registry::HKEY_CURRENT_USER\SOFTWARE\Microsoft\Office\OneNote\AddIns\River.OneMoreAddIn'
334
+ EnsurePath $0
316
335
Set-ItemProperty $0 - Name ' LoadBehavior' - Type DWord - Value 3
317
336
Set-ItemProperty $0 - Name ' Description' - Type String - Value ' Extension for OneNote'
318
337
Set-ItemProperty $0 - Name ' FriendlyName' - Type String - Value ' OneMoreAddIn'
319
338
WriteOK $0
320
339
321
- $0 = (EnsurePath ' Registry::HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\River.OneMoreAddIn.dll' )
340
+ $0 = ' Registry::HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\River.OneMoreAddIn.dll'
341
+ EnsurePath $0
322
342
Set-ItemProperty $0 - Name Path - Type String - Value $addin
323
343
WriteOK $0
324
344
WriteValue $addin
325
345
326
- $0 = (EnsurePath " Registry::HKEY_CURRENT_USER\SOFTWARE\Policies\Microsoft\Office\$offversion \Common\Security\Trusted Protocols\All Applications\onemore:" )
346
+ $0 = " Registry::HKEY_CURRENT_USER\SOFTWARE\Policies\Microsoft\Office\$offversion \Common\Security\Trusted Protocols\All Applications\onemore:"
347
+ EnsurePath $0
327
348
WriteOK $0
328
349
return $true
329
350
}
330
351
}
331
352
Process
332
353
{
333
- $vcolor = $Host.PrivateData.VerboseForegroundColor
354
+ $script : vcolor = $Host.PrivateData.VerboseForegroundColor
334
355
$Host.PrivateData.VerboseForegroundColor = ' DarkGray'
335
356
336
357
if (! (ReportOneNoteVersion)) { return }
@@ -350,6 +371,8 @@ Process
350
371
}
351
372
352
373
$ok = SetUser
353
-
354
- $Host.PrivateData.VerboseForegroundColor = $vcolor
355
374
}
375
+ End
376
+ {
377
+ $Host.PrivateData.VerboseForegroundColor = $vcolor
378
+ }
0 commit comments