~ubuntu-branches/ubuntu/natty/lightning-extension/natty-security

« back to all changes in this revision

Viewing changes to mozilla/toolkit/mozapps/installer/windows/nsis/common.nsh

  • Committer: Package Import Robot
  • Author(s): Chris Coulson, Chris Coulson, Ben Collins
  • Date: 2012-07-16 14:19:14 UTC
  • mfrom: (1.1.21)
  • Revision ID: package-import@ubuntu.com-20120716141914-mynrjxhu00lsv01h
Tags: 1.6+build1-0ubuntu0.11.04.2
* New upstream stable release (CALENDAR_1_6_BUILD1) (LP: #1024564)

[ Chris Coulson <chris.coulson@canonical.com> ]
* Fix LP: #995054 - Ensure the /usr/lib/thunderbird/extensions symlink
  exists on upgrade, which may not be the case when upgrading from a really
  old lightning version
  - add debian/lightning-extension.postinst

[ Ben Collins <bcollins@ubuntu.com> ]
* Fix LP: #1025387 - FTBFS: powerpc build fails
  - add debian/patches/fix-dtoa-build-on-ppc.patch
  - update debian/patches/series

Show diffs side-by-side

added added

removed removed

Lines of Context:
1193
1193
 * @param   _VALOPEN
1194
1194
 *          The path and args to launch the application.
1195
1195
 * @param   _VALICON
1196
 
 *          The path to an exe that contains an icon and the icon resource id.
 
1196
 *          The path to the binary that contains the icon group for the default icon
 
1197
 *          followed by a comma and either the icon group's resource index or the icon
 
1198
 *          group's resource id prefixed with a minus sign
1197
1199
 * @param   _DISPNAME
1198
1200
 *          The display name for the handler. If emtpy no value will be set.
1199
1201
 * @param   _ISPROTOCOL
1237
1239
      WriteRegStr SHCTX "$R4" "" "$R7"
1238
1240
      WriteRegStr SHCTX "$R4" "FriendlyTypeName" "$R7"
1239
1241
 
1240
 
      StrCmp "$R8" "true" +1 +8
 
1242
      StrCmp "$R8" "true" +1 +2
1241
1243
      WriteRegStr SHCTX "$R4" "URL Protocol" ""
1242
1244
      StrCpy $R3 ""
1243
 
      ClearErrors
1244
1245
      ReadRegDWord $R3 SHCTX "$R4" "EditFlags"
1245
1246
      StrCmp $R3 "" +1 +3  ; Only add EditFlags if a value doesn't exist
1246
1247
      DeleteRegValue SHCTX "$R4" "EditFlags"
1336
1337
 * @param   _VALOPEN
1337
1338
 *          The path and args to launch the application.
1338
1339
 * @param   _VALICON
1339
 
 *          The path to an exe that contains an icon and the icon resource id.
 
1340
 *          The path to the binary that contains the icon group for the default icon
 
1341
 *          followed by a comma and either the icon group's resource index or the icon
 
1342
 *          group's resource id prefixed with a minus sign
1340
1343
 * @param   _DISPNAME
1341
1344
 *          The display name for the handler. If emtpy no value will be set.
1342
1345
 * @param   _ISPROTOCOL
1389
1392
      WriteRegStr SHCTX "$R0\$R2" "" "$R5"
1390
1393
      WriteRegStr SHCTX "$R0\$R2" "FriendlyTypeName" "$R5"
1391
1394
 
1392
 
      StrCmp "$R6" "true" +1 +8
 
1395
      StrCmp "$R6" "true" +1 +2
1393
1396
      WriteRegStr SHCTX "$R0\$R2" "URL Protocol" ""
1394
1397
      StrCpy $R1 ""
1395
 
      ClearErrors
1396
1398
      ReadRegDWord $R1 SHCTX "$R0\$R2" "EditFlags"
1397
1399
      StrCmp $R1 "" +1 +3  ; Only add EditFlags if a value doesn't exist
1398
1400
      DeleteRegValue SHCTX "$R0\$R2" "EditFlags"
1485
1487
  !endif
1486
1488
!macroend
1487
1489
 
 
1490
/**
 
1491
 * Writes common registry values for a handler that DOES NOT use DDE using SHCTX.
 
1492
 *
 
1493
 * @param   _KEY
 
1494
 *          The key name in relation to the HKCR root. SOFTWARE\Classes is
 
1495
 *          prefixed to this value when using SHCTX.
 
1496
 * @param   _VALOPEN
 
1497
 *          The path and args to launch the application.
 
1498
 * @param   _VALICON
 
1499
 *          The path to the binary that contains the icon group for the default icon
 
1500
 *          followed by a comma and either the icon group's resource index or the icon
 
1501
 *          group's resource id prefixed with a minus sign
 
1502
 * @param   _DISPNAME
 
1503
 *          The display name for the handler. If emtpy no value will be set.
 
1504
 * @param   _ISPROTOCOL
 
1505
 *          Sets protocol handler specific registry values when "true".
 
1506
 *
 
1507
 * $R3 = storage for SOFTWARE\Classes
 
1508
 * $R4 = string value of the current registry key path.
 
1509
 * $R5 = _KEY
 
1510
 * $R6 = _VALOPEN
 
1511
 * $R7 = _VALICON
 
1512
 * $R8 = _DISPNAME
 
1513
 * $R9 = _ISPROTOCOL
 
1514
 */
 
1515
!macro AddDisabledDDEHandlerValues
 
1516
 
 
1517
  !ifndef ${_MOZFUNC_UN}AddDisabledDDEHandlerValues
 
1518
    !verbose push
 
1519
    !verbose ${_MOZFUNC_VERBOSE}
 
1520
    !define ${_MOZFUNC_UN}AddDisabledDDEHandlerValues "!insertmacro ${_MOZFUNC_UN}AddDisabledDDEHandlerValuesCall"
 
1521
 
 
1522
    Function ${_MOZFUNC_UN}AddDisabledDDEHandlerValues
 
1523
      Exch $R9 ; true if a protocol handler
 
1524
      Exch 1
 
1525
      Exch $R8 ; FriendlyTypeName
 
1526
      Exch 2
 
1527
      Exch $R7 ; icon index
 
1528
      Exch 3
 
1529
      Exch $R6 ; shell\open\command
 
1530
      Exch 4
 
1531
      Exch $R5 ; reg key
 
1532
      Push $R4 ;
 
1533
      Push $R3 ; base reg class
 
1534
 
 
1535
      StrCpy $R3 "SOFTWARE\Classes"
 
1536
      StrCmp "$R8" "" +6 +1
 
1537
      ReadRegStr $R4 SHCTX "$R5" "FriendlyTypeName"
 
1538
 
 
1539
      StrCmp "$R4" "" +1 +3
 
1540
      WriteRegStr SHCTX "$R3\$R5" "" "$R8"
 
1541
      WriteRegStr SHCTX "$R3\$R5" "FriendlyTypeName" "$R8"
 
1542
 
 
1543
      StrCmp "$R9" "true" +1 +2
 
1544
      WriteRegStr SHCTX "$R3\$R5" "URL Protocol" ""
 
1545
      StrCpy $R4 ""
 
1546
      ReadRegDWord $R4 SHCTX "$R3\$R5" "EditFlags"
 
1547
      StrCmp $R4 "" +1 +3  ; Only add EditFlags if a value doesn't exist
 
1548
      DeleteRegValue SHCTX "$R3\$R5" "EditFlags"
 
1549
      WriteRegDWord SHCTX "$R3\$R5" "EditFlags" 0x00000002
 
1550
 
 
1551
      StrCmp "$R7" "" +2 +1
 
1552
      WriteRegStr SHCTX "$R3\$R5\DefaultIcon" "" "$R7"
 
1553
 
 
1554
      ; Main command handler for the app
 
1555
      WriteRegStr SHCTX "$R3\$R5\shell\open\command" "" "$R6"
 
1556
 
 
1557
      ; Drop support for DDE (bug 491947), and remove old dde entries if
 
1558
      ; they exist.
 
1559
      ;
 
1560
      ; Note, changes in SHCTX should propegate to hkey classes root when
 
1561
      ; current user or local machine entries are written. Windows will also
 
1562
      ; attempt to propegate entries when a handler is used. CR entries are a
 
1563
      ; combination of LM and CU, with CU taking priority. 
 
1564
      ;
 
1565
      ; To disable dde, an empty shell/ddeexec key must be created in current
 
1566
      ; user or local machine. Unfortunately, settings have various different
 
1567
      ; behaviors depending on the windows version. The following code attempts
 
1568
      ; to address these differences.
 
1569
      ;
 
1570
      ; On XP (no SP, SP1, SP2), Vista: An empty default string
 
1571
      ; must be set under ddeexec. Empty strings propagate to CR.
 
1572
      ;
 
1573
      ; Win7: IE does not configure ddeexec, so issues with left over ddeexec keys
 
1574
      ; in LM are reduced. We configure an empty ddeexec key with an empty default
 
1575
      ; string in CU to be sure.
 
1576
      ;
 
1577
      DeleteRegKey SHCTX "SOFTWARE\Classes\$R5\shell\open\ddeexec"
 
1578
      WriteRegStr SHCTX "SOFTWARE\Classes\$R5\shell\open\ddeexec" "" ""
 
1579
 
 
1580
      ClearErrors
 
1581
 
 
1582
      Pop $R3
 
1583
      Pop $R4
 
1584
      Exch $R5
 
1585
      Exch 4
 
1586
      Exch $R6
 
1587
      Exch 3
 
1588
      Exch $R7
 
1589
      Exch 2
 
1590
      Exch $R8
 
1591
      Exch 1
 
1592
      Exch $R9
 
1593
    FunctionEnd
 
1594
 
 
1595
    !verbose pop
 
1596
  !endif
 
1597
!macroend
 
1598
 
 
1599
!macro AddDisabledDDEHandlerValuesCall _KEY _VALOPEN _VALICON _DISPNAME _ISPROTOCOL
 
1600
  !verbose push
 
1601
  !verbose ${_MOZFUNC_VERBOSE}
 
1602
  Push "${_KEY}"
 
1603
  Push "${_VALOPEN}"
 
1604
  Push "${_VALICON}"
 
1605
  Push "${_DISPNAME}"
 
1606
  Push "${_ISPROTOCOL}"
 
1607
  Call AddDisabledDDEHandlerValues
 
1608
  !verbose pop
 
1609
!macroend
 
1610
 
 
1611
!macro un.AddDisabledDDEHandlerValuesCall _KEY _VALOPEN _VALICON _DISPNAME _ISPROTOCOL
 
1612
  !verbose push
 
1613
  !verbose ${_MOZFUNC_VERBOSE}
 
1614
  Push "${_KEY}"
 
1615
  Push "${_VALOPEN}"
 
1616
  Push "${_VALICON}"
 
1617
  Push "${_DISPNAME}"
 
1618
  Push "${_ISPROTOCOL}"
 
1619
  Call un.AddDisabledDDEHandlerValues
 
1620
  !verbose pop
 
1621
!macroend
 
1622
 
 
1623
!macro un.AddDisabledDDEHandlerValues
 
1624
  !ifndef un.AddDisabledDDEHandlerValues
 
1625
    !verbose push
 
1626
    !verbose ${_MOZFUNC_VERBOSE}
 
1627
    !undef _MOZFUNC_UN
 
1628
    !define _MOZFUNC_UN "un."
 
1629
 
 
1630
    !insertmacro AddDisabledDDEHandlerValues
 
1631
 
 
1632
    !undef _MOZFUNC_UN
 
1633
    !define _MOZFUNC_UN
 
1634
    !verbose pop
 
1635
  !endif
 
1636
!macroend
 
1637
 
1488
1638
 
1489
1639
################################################################################
1490
1640
# Macros for handling DLL registration
2804
2954
      StrCmp "$R7" "$R8" +1 end
2805
2955
      DeleteRegValue HKLM "Software\Classes\$R9\DefaultIcon" ""
2806
2956
      DeleteRegValue HKLM "Software\Classes\$R9\shell\open" ""
 
2957
      DeleteRegValue HKLM "Software\Classes\$R9\shell\open\command" ""
2807
2958
      DeleteRegValue HKLM "Software\Classes\$R9\shell\ddeexec" ""
2808
2959
      DeleteRegValue HKLM "Software\Classes\$R9\shell\ddeexec\Application" ""
2809
2960
      DeleteRegValue HKLM "Software\Classes\$R9\shell\ddeexec\Topic" ""
6786
6937
            WriteRegStr HKLM "$R8" "$R9" "$AppUserModelID"
6787
6938
            ${If} ${Errors}
6788
6939
              ClearErrors
6789
 
              WriteRegStr HKLM "$R8" "$R9" "$AppUserModelID"
 
6940
              WriteRegStr HKCU "$R8" "$R9" "$AppUserModelID"
6790
6941
              ${If} ${Errors}
6791
6942
                StrCpy $AppUserModelID "error"
6792
6943
              ${EndIf}
6793
6944
            ${EndIf}
 
6945
          ${Else}
 
6946
            StrCpy $AppUserModelID $R7
6794
6947
          ${EndIf}
 
6948
        ${Else}
 
6949
          StrCpy $AppUserModelID $R7
6795
6950
        ${EndIf}
6796
6951
      ${EndIf}
6797
6952