Skip to content
Snippets Groups Projects
inst.nsi 69.5 KiB
Newer Older
  • Learn to ignore specific revisions
  • Veit Berwig's avatar
    Veit Berwig committed
    1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685
      SetOutPath "$INSTDIR\share\locale\ru\LC_MESSAGES"
      File "${INST_DIR}\share\locale\ru\LC_MESSAGES\libgpg-error.mo"
      SetOutPath "$INSTDIR\share\locale\sr\LC_MESSAGES"
      File "${INST_DIR}\share\locale\sr\LC_MESSAGES\libgpg-error.mo"
      SetOutPath "$INSTDIR\share\locale\sv\LC_MESSAGES"
      File "${INST_DIR}\share\locale\sv\LC_MESSAGES\libgpg-error.mo"
      SetOutPath "$INSTDIR\share\locale\uk\LC_MESSAGES"
      File "${INST_DIR}\share\locale\uk\LC_MESSAGES\libgpg-error.mo"
      SetOutPath "$INSTDIR\share\locale\vi\LC_MESSAGES"
      File "${INST_DIR}\share\locale\vi\LC_MESSAGES\libgpg-error.mo"
      SetOutPath "$INSTDIR\share\locale\zh_CN\LC_MESSAGES"
      File "${INST_DIR}\share\locale\zh_CN\LC_MESSAGES\libgpg-error.mo"
      SetOutPath "$INSTDIR\share\locale\zh_TW\LC_MESSAGES"
      File "${INST_DIR}\share\locale\zh_TW\LC_MESSAGES\libgpg-error.mo"
    SectionEnd
    
    Section "-zlib" SEC_zlib
      SetOutPath "$INSTDIR\bin"
      File "${INST_DIR}\bin\zlib1.dll"
    SectionEnd
    
    Section "-npth" SEC_npth
      SetOutPath "$INSTDIR\bin"
      File "${INST_DIR}\bin\libnpth-0.dll"
      SetOutPath "$INSTDIR\lib"
      File /oname=libnpth.imp "${INST_DIR}\lib\libnpth.dll.a"
      SetOutPath "$INSTDIR\include"
      File "${INST_DIR}\include\npth.h"
    SectionEnd
    
    Section "-gcrypt" SEC_gcrypt
      SetOutPath "$INSTDIR\bin"
      File "${INST_DIR}\bin\libgcrypt-20.dll"
      SetOutPath "$INSTDIR\lib"
      File /oname=libgcrypt.imp "${INST_DIR}\lib\libgcrypt.dll.a"
      SetOutPath "$INSTDIR\include"
      File "${INST_DIR}\include\gcrypt.h"
    SectionEnd
    
    Section "-assuan" SEC_assuan
      SetOutPath "$INSTDIR\bin"
      File "${INST_DIR}\bin\libassuan-9.dll"
      SetOutPath "$INSTDIR\lib"
      File /oname=libassuan.imp "${INST_DIR}\lib\libassuan.dll.a"
      SetOutPath "$INSTDIR\include"
      File "${INST_DIR}\include\assuan.h"
    SectionEnd
    
    Section "-ksba" SEC_ksba
      SetOutPath "$INSTDIR\bin"
      File "${INST_DIR}\bin\libksba-8.dll"
      SetOutPath "$INSTDIR\lib"
      File /oname=libksba.imp "${INST_DIR}\lib\libksba.dll.a"
      SetOutPath "$INSTDIR\include"
      File "${INST_DIR}\include\ksba.h"
    SectionEnd
    
    Section "-gpgme" SEC_gpgme
      SetOutPath "$INSTDIR\bin"
      File "${INST_DIR}\bin\libgpgme-11.dll"
      File /nonfatal "${INST_DIR}\bin\libgpgme-glib-11.dll"
      File "${INST_DIR}\libexec\gpgme-w32spawn.exe"
      SetOutPath "$INSTDIR\lib"
      File /oname=libgpgme.imp "${INST_DIR}\lib\libgpgme.dll.a"
      File /nonfatal /oname=libgpgme-glib.imp "${INST_DIR}\lib\libgpgme-glib.dll.a"
      SetOutPath "$INSTDIR\include"
      File "${INST_DIR}\include\gpgme.h"
    SectionEnd
    
    Section "-sqlite" SEC_sqlite
      SetOutPath "$INSTDIR\bin"
      File "${INST_DIR}\bin\libsqlite3-0.dll"
    SectionEnd
    
    !ifdef WITH_GUI
    Section "-libiconv" SEC_libiconv
      SetOutPath "$INSTDIR\bin"
      File "${INST_DIR}\bin\libiconv-2.dll"
    SectionEnd
    
    Section "-gettext" SEC_gettext
      SetOutPath "$INSTDIR\bin"
      File "${INST_DIR}\bin\libintl-8.dll"
    SectionEnd
    
    Section "-glib" SEC_glib
      SetOutPath "$INSTDIR\bin"
      File "${INST_DIR}\bin\libgio-2.0-0.dll"
      File "${INST_DIR}\bin\libglib-2.0-0.dll"
      File "${INST_DIR}\bin\libgmodule-2.0-0.dll"
      File "${INST_DIR}\bin\libgobject-2.0-0.dll"
      File "${INST_DIR}\bin\libgthread-2.0-0.dll"
      File "${INST_DIR}\bin\gspawn-win32-helper.exe"
      File "${INST_DIR}\bin\gspawn-win32-helper-console.exe"
    
      File "${INST_DIR}\bin\libffi-6.dll"
    SectionEnd
    
    Section "-libpng" SEC_libpng
      SetOutPath "$INSTDIR\bin"
      File "${INST_DIR}\bin\libpng14-14.dll"
    SectionEnd
    
    #Section "-jpeg" SEC_jpeg
    #  SetOutPath "$INSTDIR"
    #  File "${INST_DIR}\bin\jpeg62.dll"
    #SectionEnd
    
    Section "-cairo" SEC_cairo
      SetOutPath "$INSTDIR\bin"
      File "${INST_DIR}\bin\libcairo-gobject-2.dll"
      File "${INST_DIR}\bin\libpangocairo-1.0-0.dll"
      File "${INST_DIR}\bin\libcairo-2.dll"
      File "${INST_DIR}\bin\libcairo-script-interpreter-2.dll"
    SectionEnd
    
    Section "-pixman" SEC_pixman
      SetOutPath "$INSTDIR\bin"
      File "${INST_DIR}\bin\libpixman-1-0.dll"
    SectionEnd
    
    Section "-pango" SEC_pango
      SetOutPath "$INSTDIR\bin"
      File "${INST_DIR}\bin\pango-querymodules.exe"
      File "${INST_DIR}\bin\libpango-1.0-0.dll"
      File "${INST_DIR}\bin\libpangowin32-1.0-0.dll"
    
      SetOutPath "$INSTDIR\lib\pango\1.6.0\modules"
      File "${INST_DIR}\lib\pango\1.6.0\modules\pango-basic-win32.dll"
      File "${INST_DIR}\lib\pango\1.6.0\modules\pango-arabic-lang.dll"
      File "${INST_DIR}\lib\pango\1.6.0\modules\pango-indic-lang.dll"
    
      SetOutPath "$INSTDIR\etc\pango"
      File "${W32_SRCDIR}\pango.modules"
    SectionEnd
    
    Section "-atk" SEC_atk
      SetOutPath "$INSTDIR\bin"
      File "${INST_DIR}\bin\libatk-1.0-0.dll"
    SectionEnd
    
    Section "-gtk+" SEC_gtk_
      SetOutPath "$INSTDIR\bin"
      File "${INST_DIR}\bin\libgdk_pixbuf-2.0-0.dll"
      File "${INST_DIR}\bin\libgdk-win32-2.0-0.dll"
      File "${INST_DIR}\bin\libgtk-win32-2.0-0.dll"
    
      SetOutPath "$INSTDIR\lib\gdk-pixbuf-2.0\2.10.0"
      File /oname=loaders.cache "${W32_SRCDIR}\gdk-pixbuf-loaders.cache"
      SetOutPath "$INSTDIR\lib\gdk-pixbuf-2.0\2.10.0\loaders"
      File "${INST_DIR}\lib\gdk-pixbuf-2.0\2.10.0\loaders\libpixbufloader-ani.dll"
      File "${INST_DIR}\lib\gdk-pixbuf-2.0\2.10.0\loaders\libpixbufloader-gdip-bmp.dll"
      File "${INST_DIR}\lib\gdk-pixbuf-2.0\2.10.0\loaders\libpixbufloader-gdip-emf.dll"
      File "${INST_DIR}\lib\gdk-pixbuf-2.0\2.10.0\loaders\libpixbufloader-gdip-gif.dll"
      File "${INST_DIR}\lib\gdk-pixbuf-2.0\2.10.0\loaders\libpixbufloader-gdip-ico.dll"
      File "${INST_DIR}\lib\gdk-pixbuf-2.0\2.10.0\loaders\libpixbufloader-gdip-jpeg.dll"
      File "${INST_DIR}\lib\gdk-pixbuf-2.0\2.10.0\loaders\libpixbufloader-gdip-tiff.dll"
      File "${INST_DIR}\lib\gdk-pixbuf-2.0\2.10.0\loaders\libpixbufloader-gdip-wmf.dll"
      File "${INST_DIR}\lib\gdk-pixbuf-2.0\2.10.0\loaders\libpixbufloader-icns.dll"
      File "${INST_DIR}\lib\gdk-pixbuf-2.0\2.10.0\loaders\libpixbufloader-pcx.dll"
      File "${INST_DIR}\lib\gdk-pixbuf-2.0\2.10.0\loaders\libpixbufloader-png.dll"
      File "${INST_DIR}\lib\gdk-pixbuf-2.0\2.10.0\loaders\libpixbufloader-pnm.dll"
      File "${INST_DIR}\lib\gdk-pixbuf-2.0\2.10.0\loaders\libpixbufloader-qtif.dll"
      File "${INST_DIR}\lib\gdk-pixbuf-2.0\2.10.0\loaders\libpixbufloader-ras.dll"
      File "${INST_DIR}\lib\gdk-pixbuf-2.0\2.10.0\loaders\libpixbufloader-tga.dll"
      File "${INST_DIR}\lib\gdk-pixbuf-2.0\2.10.0\loaders\libpixbufloader-wbmp.dll"
      File "${INST_DIR}\lib\gdk-pixbuf-2.0\2.10.0\loaders\libpixbufloader-xbm.dll"
      File "${INST_DIR}\lib\gdk-pixbuf-2.0\2.10.0\loaders\libpixbufloader-xpm.dll"
    
      SetOutPath "$INSTDIR\lib\gtk-2.0\2.10.0\engines"
      File "${INST_DIR}\lib\gtk-2.0\2.10.0\engines\libwimp.dll"
      File "${INST_DIR}\lib\gtk-2.0\2.10.0\engines\libpixmap.dll"
    
      SetOutPath "$INSTDIR\lib\gtk-2.0\2.10.0\immodules"
      File "${INST_DIR}\lib\gtk-2.0\2.10.0\immodules\im-thai.dll"
      File "${INST_DIR}\lib\gtk-2.0\2.10.0\immodules\im-cyrillic-translit.dll"
      File "${INST_DIR}\lib\gtk-2.0\2.10.0\immodules\im-multipress.dll"
      File "${INST_DIR}\lib\gtk-2.0\2.10.0\immodules\im-ti-er.dll"
      File "${INST_DIR}\lib\gtk-2.0\2.10.0\immodules\im-am-et.dll"
      File "${INST_DIR}\lib\gtk-2.0\2.10.0\immodules\im-cedilla.dll"
      File "${INST_DIR}\lib\gtk-2.0\2.10.0\immodules\im-inuktitut.dll"
      File "${INST_DIR}\lib\gtk-2.0\2.10.0\immodules\im-viqr.dll"
      File "${INST_DIR}\lib\gtk-2.0\2.10.0\immodules\im-ti-et.dll"
      File "${INST_DIR}\lib\gtk-2.0\2.10.0\immodules\im-ipa.dll"
      File "${INST_DIR}\lib\gtk-2.0\2.10.0\immodules\im-ime.dll"
    
      SetOutPath "$INSTDIR\share\themes\Default\gtk-2.0-key"
      File "${INST_DIR}\share\themes\Default\gtk-2.0-key\gtkrc"
    
      SetOutPath "$INSTDIR\share\themes\MS-Windows\gtk-2.0"
      File "${INST_DIR}\share\themes\MS-Windows\gtk-2.0\gtkrc"
    
      SetOutPath "$INSTDIR\etc\gtk-2.0"
      File "${INST_DIR}\etc\gtk-2.0\im-multipress.conf"
    SectionEnd
    !endif
    
    Section "-pinentry" SEC_pinentry
      SetOutPath "$INSTDIR\bin"
      File /oname=pinentry-basic.exe "${INST_DIR}\bin\pinentry-w32.exe"
    SectionEnd
    
    !ifdef WITH_GUI
    Section "gpa" SEC_gpa
      SectionIn RO
      SetOutPath "$INSTDIR\bin"
      File "${INST_DIR}\bin\gpa.exe"
      File "${INST_DIR}\bin\launch-gpa.exe"
    SectionEnd
    
    LangString DESC_SEC_gpa ${LANG_ENGLISH} \
       "The GnuPG Assistant is the graphical interface of GnuPG"
    LangString DESC_SEC_gpa ${LANG_GERMAN} \
       "Der GnuPG Assistent ist die graphische Oberfläche von GnuPG."
    
    LangString DESC_Menu_gpa ${LANG_ENGLISH} \
       "Run the GnuGP Assistant."
    LangString DESC_Menu_gpa ${LANG_GERMAN} \
       "Den GnuPG Assistenten starten."
    
    Section "gpgex" SEC_gpgex
      SetOutPath "$INSTDIR\bin"
    
      ClearErrors
      SetOverwrite try
      File "${INST_DIR}\bin\gpgex.dll"
      SetOverwrite lastused
      ifErrors 0 do_reg
          File /oname=gpgex.dll.tmp "${INST_DIR}\bin\gpgex.dll"
          Rename /REBOOTOK gpgex.dll.tmp gpgex.dll
    
     do_reg:
      ClearErrors
      RegDLL "$INSTDIR\bin\gpgex.dll"
      ifErrors 0 +2
         MessageBox MB_OK "$(T_GPGEX_RegFailed)"
    
    ${If} ${RunningX64}
      # Install the 64 bit version of the plugin.
      # Note that we install this in addition to the 32 bit version so that
      # the 32 bit version can be used by file dialogs of 32 bit programs.
      ClearErrors
      SetOverwrite try
      File /oname=gpgex6.dll "${INST6_DIR}\bin\gpgex.dll"
      SetOverwrite lastused
      ifErrors 0 do_reg64
          File /oname=gpgex6.dll.tmp "${INST6_DIR}\bin\gpgex.dll"
          Rename /REBOOTOK gpgex6.dll.tmp gpgex6.dll
    
     do_reg64:
      # Register the DLL. We need to register both versions.  However
      # RegDLL can't be used for 64 bit and InstallLib seems to be a
      # registry hack.
      ClearErrors
      nsExec::ExecToLog '"$SYSDIR\regsvr32" "/s" "$INSTDIR\bin\gpgex6.dll"'
      ifErrors 0 +2
         MessageBox MB_OK "$(T_GPGEX_RegFailed) (64 bit)"
    
      # Note: There is no need to install the help an mo files because
      # they are identical to those installed by the 32 bit version.
    ${EndIf}
    SectionEnd
    
    LangString T_GPGEX_RegFailed ${LANG_ENGLISH} \
       "Warning: Registration of the Explorer plugin failed."
    
    LangString DESC_SEC_gpgex ${LANG_ENGLISH} \
       "GnuPG Explorer Extension"
    
    !endif
    
    
    Section "-gnupglast" SEC_gnupglast
      SetOutPath "$INSTDIR"
    SectionEnd
    
    
    #
    # Define the uninstaller sections.
    #
    # (reverse order of the installer sections!)
    #
    
    Section "-un.gnupglast"
      ifFileExists "$INSTDIR\bin\launch-gpa.exe"  0 no_uiserver
        nsExec::ExecToLog '"$INSTDIR\bin\launch-gpa" "--stop-server"'
      no_uiserver:
      ifFileExists "$INSTDIR\bin\gpgconf.exe"  0 no_gpgconf
        nsExec::ExecToLog '"$INSTDIR\bin\gpgconf" "--kill" "gpg-agent"'
        nsExec::ExecToLog '"$INSTDIR\bin\gpgconf" "--kill" "dirmngr"'
      no_gpgconf:
    SectionEnd
    
    Section "-un.gpgex"
      UnRegDLL "$INSTDIR\bin\gpgex.dll"
    
      Delete /REBOOTOK "$INSTDIR\bin\gpgex.dll"
    
    ${If} ${RunningX64}
      nsExec::ExecToLog '"$SYSDIR\regsvr32" "/u" "/s" "$INSTDIR\bin\gpgex6.dll"'
      Delete /REBOOTOK "$INSTDIR\bin\gpgex6.dll"
    ${EndIf}
    SectionEnd
    
    !ifdef WITH_GUI
    Section "-un.gpa"
      Delete "$INSTDIR\bin\gpa.exe"
      Delete "$INSTDIR\bin\launch-gpa.exe"
    
      RMDir "$INSTDIR\share\gpa"
    SectionEnd
    !endif
    
    Section "-un.pinentry"
      Delete "$INSTDIR\bin\pinentry-basic.exe"
    SectionEnd
    
    !ifdef WITH_GUI
    Section "-un.gtk+"
      Delete "$INSTDIR\bin\libgdk_pixbuf-2.0-0.dll"
      Delete "$INSTDIR\bin\libgdk-win32-2.0-0.dll"
      Delete "$INSTDIR\bin\libgtk-win32-2.0-0.dll"
    
      Delete "$INSTDIR\lib\gdk-pixbuf-2.0\2.10.0\loaders.cache"
    
      Delete "$INSTDIR\lib\gdk-pixbuf-2.0\2.10.0\loaders\libpixbufloader-ani.dll"
      Delete "$INSTDIR\lib\gdk-pixbuf-2.0\2.10.0\loaders\libpixbufloader-gdip-bmp.dll"
      Delete "$INSTDIR\lib\gdk-pixbuf-2.0\2.10.0\loaders\libpixbufloader-gdip-emf.dll"
      Delete "$INSTDIR\lib\gdk-pixbuf-2.0\2.10.0\loaders\libpixbufloader-gdip-gif.dll"
      Delete "$INSTDIR\lib\gdk-pixbuf-2.0\2.10.0\loaders\libpixbufloader-gdip-ico.dll"
      Delete "$INSTDIR\lib\gdk-pixbuf-2.0\2.10.0\loaders\libpixbufloader-gdip-jpeg.dll"
      Delete "$INSTDIR\lib\gdk-pixbuf-2.0\2.10.0\loaders\libpixbufloader-gdip-tiff.dll"
      Delete "$INSTDIR\lib\gdk-pixbuf-2.0\2.10.0\loaders\libpixbufloader-gdip-wmf.dll"
      Delete "$INSTDIR\lib\gdk-pixbuf-2.0\2.10.0\loaders\libpixbufloader-icns.dll"
      Delete "$INSTDIR\lib\gdk-pixbuf-2.0\2.10.0\loaders\libpixbufloader-pcx.dll"
      Delete "$INSTDIR\lib\gdk-pixbuf-2.0\2.10.0\loaders\libpixbufloader-png.dll"
      Delete "$INSTDIR\lib\gdk-pixbuf-2.0\2.10.0\loaders\libpixbufloader-pnm.dll"
      Delete "$INSTDIR\lib\gdk-pixbuf-2.0\2.10.0\loaders\libpixbufloader-qtif.dll"
      Delete "$INSTDIR\lib\gdk-pixbuf-2.0\2.10.0\loaders\libpixbufloader-ras.dll"
      Delete "$INSTDIR\lib\gdk-pixbuf-2.0\2.10.0\loaders\libpixbufloader-tga.dll"
      Delete "$INSTDIR\lib\gdk-pixbuf-2.0\2.10.0\loaders\libpixbufloader-wbmp.dll"
      Delete "$INSTDIR\lib\gdk-pixbuf-2.0\2.10.0\loaders\libpixbufloader-xbm.dll"
      Delete "$INSTDIR\lib\gdk-pixbuf-2.0\2.10.0\loaders\libpixbufloader-xpm.dll"
      RMDir  "$INSTDIR\lib\gdk-pixbuf-2.0\2.10.0\loaders"
      RMDir  "$INSTDIR\lib\gdk-pixbuf-2.0\2.10.0"
      RMDir  "$INSTDIR\lib\gdk-pixbuf-2.0"
    
      Delete "$INSTDIR\lib\gtk-2.0\2.10.0\engines\libwimp.dll"
      Delete "$INSTDIR\lib\gtk-2.0\2.10.0\engines\libpixmap.dll"
      RMDir  "$INSTDIR\lib\gtk-2.0\2.10.0\engines"
    
      Delete "$INSTDIR\lib\gtk-2.0\2.10.0\immodules\im-thai.dll"
      Delete "$INSTDIR\lib\gtk-2.0\2.10.0\immodules\im-cyrillic-translit.dll"
      Delete "$INSTDIR\lib\gtk-2.0\2.10.0\immodules\im-multipress.dll"
      Delete "$INSTDIR\lib\gtk-2.0\2.10.0\immodules\im-ti-er.dll"
      Delete "$INSTDIR\lib\gtk-2.0\2.10.0\immodules\im-am-et.dll"
      Delete "$INSTDIR\lib\gtk-2.0\2.10.0\immodules\im-cedilla.dll"
      Delete "$INSTDIR\lib\gtk-2.0\2.10.0\immodules\im-inuktitut.dll"
      Delete "$INSTDIR\lib\gtk-2.0\2.10.0\immodules\im-viqr.dll"
      Delete "$INSTDIR\lib\gtk-2.0\2.10.0\immodules\im-ti-et.dll"
      Delete "$INSTDIR\lib\gtk-2.0\2.10.0\immodules\im-ipa.dll"
      Delete "$INSTDIR\lib\gtk-2.0\2.10.0\immodules\im-ime.dll"
      RMDir  "$INSTDIR\lib\gtk-2.0\2.10.0\immodules"
    
      RMDir  "$INSTDIR\lib\gtk-2.0\2.10.0"
      RMDir  "$INSTDIR\lib\gtk-2.0"
    
      Delete "$INSTDIR\share\themes\Default\gtk-2.0-key\gtkrc"
      RMDir  "$INSTDIR\share\themes\Default\gtk-2.0-key"
      RMDir  "$INSTDIR\share\themes\Default"
    
      Delete "$INSTDIR\share\themes\MS-Windows\gtk-2.0\gtkrc"
      RMDir  "$INSTDIR\share\themes\MS-Windows\gtk-2.0"
      RMDir  "$INSTDIR\share\themes\MS-Windows"
    
      RMDir  "$INSTDIR\share\themes"
    
      Delete "$INSTDIR\etc\gtk-2.0\im-multipress.conf"
      RMDir  "$INSTDIR\etc\gtk-2.0"
    SectionEnd
    
    Section "-un.atk"
      Delete "$INSTDIR\bin\libatk-1.0-0.dll"
    SectionEnd
    
    Section "-un.pango"
      Delete "$INSTDIR\bin\pango-querymodules.exe"
      Delete "$INSTDIR\bin\libpango-1.0-0.dll"
      Delete "$INSTDIR\bin\libpangowin32-1.0-0.dll"
    
      Delete "$INSTDIR\lib\pango\1.6.0\modules\pango-basic-win32.dll"
      Delete "$INSTDIR\lib\pango\1.6.0\modules\pango-arabic-lang.dll"
      Delete "$INSTDIR\lib\pango\1.6.0\modules\pango-indic-lang.dll"
      RMDir  "$INSTDIR\lib\pango\1.6.0\modules"
      RMDir  "$INSTDIR\lib\pango\1.6.0"
      RMDir  "$INSTDIR\lib\pango"
    
      Delete "$INSTDIR\etc\pango\pango.modules"
      RMDir  "$INSTDIR\etc\pango"
    SectionEnd
    
    Section "-un.pixman"
      Delete "$INSTDIR\bin\libpixman-1-0.dll"
    SectionEnd
    
    Section "-un.cairo"
      Delete "$INSTDIR\bin\libcairo-gobject-2.dll"
      Delete "$INSTDIR\bin\libpangocairo-1.0-0.dll"
      Delete "$INSTDIR\bin\libcairo-2.dll"
      Delete "$INSTDIR\bin\libcairo-script-interpreter-2.dll"
    SectionEnd
    
    Section "-un.libpng"
      Delete "$INSTDIR\bin\libpng14-14.dll"
    SectionEnd
    
    Section "-un.glib"
      Delete "$INSTDIR\bin\libgio-2.0-0.dll"
      Delete "$INSTDIR\bin\libglib-2.0-0.dll"
      Delete "$INSTDIR\bin\libgmodule-2.0-0.dll"
      Delete "$INSTDIR\bin\libgobject-2.0-0.dll"
      Delete "$INSTDIR\bin\libgthread-2.0-0.dll"
      Delete "$INSTDIR\bin\gspawn-win32-helper.exe"
      Delete "$INSTDIR\bin\gspawn-win32-helper-console.exe"
      Delete "$INSTDIR\bin\libffi-6.dll"
    SectionEnd
    !endif
    
    
    Section "-un.gettext"
      Delete "$INSTDIR\bin\libintl-8.dll"
    SectionEnd
    
    Section "-un.libiconv"
      Delete "$INSTDIR\bin\libiconv-2.dll"
    SectionEnd
    
    Section "-un.gpgme"
      Delete "$INSTDIR\bin\libgpgme-11.dll"
      Delete "$INSTDIR\bin\libgpgme-glib-11.dll"
      Delete "$INSTDIR\bin\gpgme-w32spawn.exe"
      Delete "$INSTDIR\lib\libgpgme.imp"
      Delete "$INSTDIR\lib\libgpgme-glib.imp"
      Delete "$INSTDIR\include\gpgme.h"
    SectionEnd
    
    Section "-un.ksba"
      Delete "$INSTDIR\bin\libksba-8.dll"
      Delete "$INSTDIR\lib\libksba.imp"
      Delete "$INSTDIR\include\ksba.h"
    SectionEnd
    
    Section "-un.assuan"
      Delete "$INSTDIR\bin\libassuan-9.dll"
      Delete "$INSTDIR\lib\libassuan.imp"
      Delete "$INSTDIR\include\assuan.h"
    SectionEnd
    
    Section "-un.gcrypt"
      Delete "$INSTDIR\bin\libgcrypt-20.dll"
      Delete "$INSTDIR\lib\libgcrypt.imp"
      Delete "$INSTDIR\include\gcrypt.h"
    SectionEnd
    
    Section "-un.npth"
      Delete "$INSTDIR\bin\libnpth-0.dll"
      Delete "$INSTDIR\lib\libnpth.imp"
      Delete "$INSTDIR\include\npth.h"
    SectionEnd
    
    Section "-un.zlib"
      Delete "$INSTDIR\bin\zlib1.dll"
    SectionEnd
    
    Section "-un.libgpg-error"
      Delete "$INSTDIR\bin\libgpg-error-0.dll"
      Delete "$INSTDIR\lib\libgpg-error.imp"
      Delete "$INSTDIR\include\gpg-error.h"
      Delete "$INSTDIR\share\locale\cs\LC_MESSAGES\libgpg-error.mo"
      RMDir "$INSTDIR\share\locale\cs\LC_MESSAGES"
      RMDir "$INSTDIR\share\locale\cs"
      Delete "$INSTDIR\share\locale\da\LC_MESSAGES\libgpg-error.mo"
      RMDir "$INSTDIR\share\locale\da\LC_MESSAGES"
      RMDir "$INSTDIR\share\locale\da"
      Delete "$INSTDIR\share\locale\de\LC_MESSAGES\libgpg-error.mo"
      RMDir "$INSTDIR\share\locale\de\LC_MESSAGES"
      RMDir "$INSTDIR\share\locale\de"
      Delete "$INSTDIR\share\locale\eo\LC_MESSAGES\libgpg-error.mo"
      RMDir "$INSTDIR\share\locale\eo\LC_MESSAGES"
      RMDir "$INSTDIR\share\locale\eo"
      Delete "$INSTDIR\share\locale\es\LC_MESSAGES\libgpg-error.mo"
      RMDir "$INSTDIR\share\locale\es\LC_MESSAGES"
      RMDir "$INSTDIR\share\locale\es"
      Delete "$INSTDIR\share\locale\fr\LC_MESSAGES\libgpg-error.mo"
      RMDir "$INSTDIR\share\locale\fr\LC_MESSAGES"
      RMDir "$INSTDIR\share\locale\fr"
      Delete "$INSTDIR\share\locale\hu\LC_MESSAGES\libgpg-error.mo"
      RMDir "$INSTDIR\share\locale\hu\LC_MESSAGES"
      RMDir "$INSTDIR\share\locale\hu"
      Delete "$INSTDIR\share\locale\it\LC_MESSAGES\libgpg-error.mo"
      RMDir "$INSTDIR\share\locale\it\LC_MESSAGES"
      RMDir "$INSTDIR\share\locale\it"
      Delete "$INSTDIR\share\locale\ja\LC_MESSAGES\libgpg-error.mo"
      RMDir "$INSTDIR\share\locale\ja\LC_MESSAGES"
      RMDir "$INSTDIR\share\locale\ja"
      Delete "$INSTDIR\share\locale\nl\LC_MESSAGES\libgpg-error.mo"
      RMDir "$INSTDIR\share\locale\nl\LC_MESSAGES"
      RMDir "$INSTDIR\share\locale\nl"
      Delete "$INSTDIR\share\locale\pl\LC_MESSAGES\libgpg-error.mo"
      RMDir "$INSTDIR\share\locale\pl\LC_MESSAGES"
      RMDir "$INSTDIR\share\locale\pl"
      Delete "$INSTDIR\share\locale\pt\LC_MESSAGES\libgpg-error.mo"
      RMDir "$INSTDIR\share\locale\pt\LC_MESSAGES"
      RMDir "$INSTDIR\share\locale\pt"
      Delete "$INSTDIR\share\locale\ro\LC_MESSAGES\libgpg-error.mo"
      RMDir "$INSTDIR\share\locale\ro\LC_MESSAGES"
      RMDir "$INSTDIR\share\locale\ro"
      Delete "$INSTDIR\share\locale\ru\LC_MESSAGES\libgpg-error.mo"
      RMDir "$INSTDIR\share\locale\ru\LC_MESSAGES"
      RMDir "$INSTDIR\share\locale\ru"
      Delete "$INSTDIR\share\locale\sr\LC_MESSAGES\libgpg-error.mo"
      RMDir "$INSTDIR\share\locale\sr\LC_MESSAGES"
      RMDir "$INSTDIR\share\locale\sr"
      Delete "$INSTDIR\share\locale\sv\LC_MESSAGES\libgpg-error.mo"
      RMDir "$INSTDIR\share\locale\sv\LC_MESSAGES"
      RMDir "$INSTDIR\share\locale\sv"
      Delete "$INSTDIR\share\locale\uk\LC_MESSAGES\libgpg-error.mo"
      RMDir "$INSTDIR\share\locale\uk\LC_MESSAGES"
      RMDir "$INSTDIR\share\locale\uk"
      Delete "$INSTDIR\share\locale\vi\LC_MESSAGES\libgpg-error.mo"
      RMDir "$INSTDIR\share\locale\vi\LC_MESSAGES"
      RMDir "$INSTDIR\share\locale\vi"
      Delete "$INSTDIR\share\locale\zh_CN\LC_MESSAGES\libgpg-error.mo"
      RMDir "$INSTDIR\share\locale\zh_CN\LC_MESSAGES"
      RMDir "$INSTDIR\share\locale\zh_CN"
      Delete "$INSTDIR\share\locale\zh_TW\LC_MESSAGES\libgpg-error.mo"
      RMDir "$INSTDIR\share\locale\zh_TW\LC_MESSAGES"
      RMDir "$INSTDIR\share\locale\zh_TW"
      RMDir "$INSTDIR\share\locale"
    SectionEnd
    
    Section "-un.gnupg"
      Delete "$INSTDIR\bin\gpg.exe"
      Delete "$INSTDIR\bin\gpgv.exe"
      Delete "$INSTDIR\bin\gpgsm.exe"
      Delete "$INSTDIR\bin\gpg-agent.exe"
      Delete "$INSTDIR\bin\scdaemon.exe"
      Delete "$INSTDIR\bin\dirmngr.exe"
      Delete "$INSTDIR\bin\gpgconf.exe"
      Delete "$INSTDIR\bin\gpg-connect-agent.exe"
      Delete "$INSTDIR\bin\gpgtar.exe"
      Delete "$INSTDIR\bin\dirmngr_ldap.exe"
      Delete "$INSTDIR\bin\gpg-preset-passphrase.exe"
      Delete "$INSTDIR\bin\gpg-check-pattern.exe"
      Delete "$INSTDIR\bin\gpg-wks-client.exe"
    
      Delete "$INSTDIR\share\doc\gnupg\examples\Automatic.prf"
      Delete "$INSTDIR\share\doc\gnupg\examples\Brainpool256.prf"
      Delete "$INSTDIR\share\doc\gnupg\examples\Brainpool384.prf"
      Delete "$INSTDIR\share\doc\gnupg\examples\Brainpool512.prf"
      Delete "$INSTDIR\share\doc\gnupg\examples\Curve25519.prf"
      Delete "$INSTDIR\share\doc\gnupg\examples\Curve448.prf"
      Delete "$INSTDIR\share\doc\gnupg\examples\Curve-secp256k1.prf"
      Delete "$INSTDIR\share\doc\gnupg\examples\pwpattern.list"
      Delete "$INSTDIR\share\doc\gnupg\examples\RSA-4096.prf"
      Delete "$INSTDIR\share\doc\gnupg\examples\VS-NfD.prf"
    
      RMDir  "$INSTDIR\share\doc\gnupg\examples"
      RMDir  "$INSTDIR\share\doc\gnupg"
    
      Delete "$INSTDIR\share\gnupg\sks-keyservers.netCA.pem"
      Delete "$INSTDIR\share\gnupg\dirmngr-conf.skel"
      Delete "$INSTDIR\share\gnupg\distsigkey.gpg"
      Delete "$INSTDIR\share\gnupg\gpg-conf.skel"
      RMDir  "$INSTDIR\share\gnupg"
    
      Delete "$INSTDIR\share\locale\ca\LC_MESSAGES\gnupg2.mo"
      RMDir "$INSTDIR\share\locale\ca\LC_MESSAGES"
      RMDir "$INSTDIR\share\locale\ca"
      Delete "$INSTDIR\share\locale\cs\LC_MESSAGES\gnupg2.mo"
      RMDir "$INSTDIR\share\locale\cs\LC_MESSAGES"
      RMDir "$INSTDIR\share\locale\cs"
      Delete "$INSTDIR\share\locale\da\LC_MESSAGES\gnupg2.mo"
      RMDir "$INSTDIR\share\locale\da\LC_MESSAGES"
      RMDir "$INSTDIR\share\locale\da"
      Delete "$INSTDIR\share\locale\de\LC_MESSAGES\gnupg2.mo"
      RMDir "$INSTDIR\share\locale\de\LC_MESSAGES"
      RMDir "$INSTDIR\share\locale\de"
      Delete "$INSTDIR\share\locale\el\LC_MESSAGES\gnupg2.mo"
      RMDir "$INSTDIR\share\locale\el\LC_MESSAGES"
      RMDir "$INSTDIR\share\locale\el"
      Delete "$INSTDIR\share\locale\en@boldquot\LC_MESSAGES\gnupg2.mo"
      RMDir "$INSTDIR\share\locale\en@boldquot\LC_MESSAGES"
      RMDir "$INSTDIR\share\locale\en@boldquot"
      Delete "$INSTDIR\share\locale\en@quot\LC_MESSAGES\gnupg2.mo"
      RMDir "$INSTDIR\share\locale\en@quot\LC_MESSAGES"
      RMDir "$INSTDIR\share\locale\en@quot"
      Delete "$INSTDIR\share\locale\eo\LC_MESSAGES\gnupg2.mo"
      RMDir "$INSTDIR\share\locale\eo\LC_MESSAGES"
      RMDir "$INSTDIR\share\locale\eo"
      Delete "$INSTDIR\share\locale\es\LC_MESSAGES\gnupg2.mo"
      RMDir "$INSTDIR\share\locale\es\LC_MESSAGES"
      RMDir "$INSTDIR\share\locale\es"
      Delete "$INSTDIR\share\locale\et\LC_MESSAGES\gnupg2.mo"
      RMDir "$INSTDIR\share\locale\et\LC_MESSAGES"
      RMDir "$INSTDIR\share\locale\et"
      Delete "$INSTDIR\share\locale\fi\LC_MESSAGES\gnupg2.mo"
      RMDir "$INSTDIR\share\locale\fi\LC_MESSAGES"
      RMDir "$INSTDIR\share\locale\fi"
      Delete "$INSTDIR\share\locale\fr\LC_MESSAGES\gnupg2.mo"
      RMDir "$INSTDIR\share\locale\fr\LC_MESSAGES"
      RMDir "$INSTDIR\share\locale\fr"
      Delete "$INSTDIR\share\locale\gl\LC_MESSAGES\gnupg2.mo"
      RMDir "$INSTDIR\share\locale\gl\LC_MESSAGES"
      RMDir "$INSTDIR\share\locale\gl"
      Delete "$INSTDIR\share\locale\hu\LC_MESSAGES\gnupg2.mo"
      RMDir "$INSTDIR\share\locale\hu\LC_MESSAGES"
      RMDir "$INSTDIR\share\locale\hu"
      Delete "$INSTDIR\share\locale\id\LC_MESSAGES\gnupg2.mo"
      RMDir "$INSTDIR\share\locale\id\LC_MESSAGES"
      RMDir "$INSTDIR\share\locale\id"
      Delete "$INSTDIR\share\locale\it\LC_MESSAGES\gnupg2.mo"
      RMDir "$INSTDIR\share\locale\it\LC_MESSAGES"
      RMDir "$INSTDIR\share\locale\it"
      Delete "$INSTDIR\share\locale\ja\LC_MESSAGES\gnupg2.mo"
      RMDir "$INSTDIR\share\locale\ja\LC_MESSAGES"
      RMDir "$INSTDIR\share\locale\ja"
      Delete "$INSTDIR\share\locale\nb\LC_MESSAGES\gnupg2.mo"
      RMDir "$INSTDIR\share\locale\nb\LC_MESSAGES"
      RMDir "$INSTDIR\share\locale\nb"
      Delete "$INSTDIR\share\locale\pl\LC_MESSAGES\gnupg2.mo"
      RMDir "$INSTDIR\share\locale\pl\LC_MESSAGES"
      RMDir "$INSTDIR\share\locale\pl"
      Delete "$INSTDIR\share\locale\pt\LC_MESSAGES\gnupg2.mo"
      RMDir "$INSTDIR\share\locale\pt\LC_MESSAGES"
      RMDir "$INSTDIR\share\locale\pt"
      Delete "$INSTDIR\share\locale\ro\LC_MESSAGES\gnupg2.mo"
      RMDir "$INSTDIR\share\locale\ro\LC_MESSAGES"
      RMDir "$INSTDIR\share\locale\ro"
      Delete "$INSTDIR\share\locale\ru\LC_MESSAGES\gnupg2.mo"
      RMDir "$INSTDIR\share\locale\ru\LC_MESSAGES"
      RMDir "$INSTDIR\share\locale\ru"
      Delete "$INSTDIR\share\locale\sk\LC_MESSAGES\gnupg2.mo"
      RMDir "$INSTDIR\share\locale\sk\LC_MESSAGES"
      RMDir "$INSTDIR\share\locale\sk"
      Delete "$INSTDIR\share\locale\sv\LC_MESSAGES\gnupg2.mo"
      RMDir "$INSTDIR\share\locale\sv\LC_MESSAGES"
      RMDir "$INSTDIR\share\locale\sv"
      Delete "$INSTDIR\share\locale\tr\LC_MESSAGES\gnupg2.mo"
      RMDir "$INSTDIR\share\locale\tr\LC_MESSAGES"
      RMDir "$INSTDIR\share\locale\tr"
      Delete "$INSTDIR\share\locale\uk\LC_MESSAGES\gnupg2.mo"
      RMDir "$INSTDIR\share\locale\uk\LC_MESSAGES"
      RMDir "$INSTDIR\share\locale\uk"
      Delete "$INSTDIR\share\locale\zh_CN\LC_MESSAGES\gnupg2.mo"
      RMDir "$INSTDIR\share\locale\zh_CN\LC_MESSAGES"
      RMDir "$INSTDIR\share\locale\zh_CN"
      Delete "$INSTDIR\share\locale\zh_TW\LC_MESSAGES\gnupg2.mo"
      RMDir "$INSTDIR\share\locale\zh_TW\LC_MESSAGES"
      RMDir "$INSTDIR\share\locale\zh_TW"
      RMDir "$INSTDIR\share\locale"
    SectionEnd
    
    Section "-un.sqlite"
      Delete "$INSTDIR\bin\libsqlite3-0.dll"
    SectionEnd
    
    Section "-un.gnupginst"
      # Delete standard stuff.
      Delete "$INSTDIR\README.txt"
    
      Delete "$INSTDIR\VERSION"
    
      # Remove the bin directory from the PATH
      Push "$INSTDIR\bin"
      Call un.RemoveFromPath
    
      # Try to remove the top level directories.
      RMDir "$INSTDIR\bin"
      RMDir "$INSTDIR\lib"
      RMDir "$INSTDIR\include"
      RMDir "$INSTDIR\share"
      RMDir "$INSTDIR\etc"
      RMDir "$INSTDIR"
    
    
    Veit Berwig's avatar
    Veit Berwig committed
      # Remove global central config
      # ${VSNFD_CFG_TARGET} is: "$COMMONPROGRAMDATA\GNU"
    
      ifFileExists "${VSNFD_CFG_TARGET}\etc\*.*"  0 no_rmetc
        RMDir /r "${VSNFD_CFG_TARGET}"
    
        #---------------------------------------------------
        # Temove the menu entries for VSD-Docs
        #---------------------------------------------------
        Delete "$SMPROGRAMS\GnuPG Doc.lnk"
    
      no_rmetc:
    
    
    Veit Berwig's avatar
    Veit Berwig committed
      # Clean the registry.
      DeleteRegValue SHCTX "Software\GNU\GnuPG" "Install Directory"
    SectionEnd
    
    
    Function .onInit
      ;;!define MUI_LANGDLL_ALWAYSSHOW
      !insertmacro MUI_LANGDLL_DISPLAY
    
      Call G4wRunOnce
    
      SetOutPath $TEMP
    #!ifdef SOURCES
    #  File /oname=gpgspltmp.bmp "${TOP_SRCDIR}\doc\logo\gnupg-logo-400px.bmp"
    #  # We play the tune only for the soruce installer
    #  File /oname=gpgspltmp.wav "${TOP_SRCDIR}\src\gnupg-splash.wav"
    #  g4wihelp::playsound $TEMP\gpgspltmp.wav
    #  g4wihelp::showsplash 2500 $TEMP\gpgspltmp.bmp
    
    #  Delete $TEMP\gpgspltmp.bmp
    #  # Note that we delete gpgspltmp.wav in .onInst{Failed,Success}
    #!endif
    
      # We can't use TOP_SRCDIR dir as the name of the file needs to be
      # the same while building and running the installer.  Thus we
      # generate the file from a template.
      !insertmacro MUI_INSTALLOPTIONS_EXTRACT "inst-options.ini"
    
      #Call CalcDepends
    
      Var /GLOBAL changed_dir
      # Check if the install directory was modified on the command line
      StrCmp "$INSTDIR" "$PROGRAMFILES\${INSTALL_DIR}" unmodified 0
      # It is modified. Save that value.
      StrCpy $changed_dir "$INSTDIR"
    
      # MULITUSER_INIT overwrites directory setting from command line
      !insertmacro MULTIUSER_INIT
      StrCpy $INSTDIR "$changed_dir"
      goto initDone
    unmodified:
      !insertmacro MULTIUSER_INIT
    initDone:
    FunctionEnd
    
    Function "un.onInit"
      !insertmacro MULTIUSER_UNINIT
    FunctionEnd
    
    #Function .onInstFailed
    #  Delete $TEMP\gpgspltmp.wav
    #FunctionEnd
    
    #Function .onInstSuccess
    #  Delete $TEMP\gpgspltmp.wav
    #FunctionEnd
    
    #Function .onSelChange
    #  Call CalcDepends
    #FunctionEnd
    
    
    # This must be in a central place.  Urgs.
    
    !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
    !insertmacro MUI_DESCRIPTION_TEXT ${SEC_gnupg} $(DESC_SEC_gnupg)
    !insertmacro MUI_DESCRIPTION_TEXT ${SEC_gpa}   $(DESC_SEC_gpa)
    !insertmacro MUI_DESCRIPTION_TEXT ${SEC_gpgex} $(DESC_SEC_gpgex)
    !insertmacro MUI_FUNCTION_DESCRIPTION_END
    
    
    # This also must be in a central place.  Also Urgs.
    
    !ifdef WITH_GUI
    Section "-startmenu"
    
      # Check if the start menu entries where requested.
      !insertmacro MUI_INSTALLOPTIONS_READ $R0 "inst-options.ini" \
    	"Field 2" "State"
      IntCmp $R0 0 no_start_menu
    
    !insertmacro MUI_STARTMENU_WRITE_BEGIN Application
        CreateDirectory "$SMPROGRAMS\$STARTMENU_FOLDER"
    
        SectionGetFlags ${SEC_gpa} $R0
        IntOp $R0 $R0 & ${SF_SELECTED}
        IntCmp $R0 ${SF_SELECTED} 0 no_gpa_menu
        CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\GPA.lnk" \
    	"$INSTDIR\bin\launch-gpa.exe" \
            "" "" "" SW_SHOWNORMAL "" $(DESC_Menu_gpa)
      no_gpa_menu:
    
    
        CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\GnuPG Manual.lnk" \
                       "$INSTDIR\share\gnupg\gnupg.html" \
                       "" "" "" SW_SHOWNORMAL "" $(DESC_Menu_gnupg_manual)
    
        CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\GnuPG README.lnk" \
                       "$INSTDIR\README.txt" \
                       "" "" "" SW_SHOWNORMAL "" $(DESC_Menu_gnupg_readme)
    
    !insertmacro MUI_STARTMENU_WRITE_END
    
    
    
    no_start_menu:
    
    
      # Check if the desktop entries where requested.
      !insertmacro MUI_INSTALLOPTIONS_READ $R0 "inst-options.ini" \
    	"Field 3" "State"
      IntCmp $R0 0 no_desktop
    
        SectionGetFlags ${SEC_gpa} $R0
        IntOp $R0 $R0 & ${SF_SELECTED}
        IntCmp $R0 ${SF_SELECTED} 0 no_gpa_desktop
        CreateShortCut "$DESKTOP\GPA.lnk" \
    	"$INSTDIR\bin\launch-gpa.exe" \
            "" "" "" SW_SHOWNORMAL "" $(DESC_Menu_gpa)
      no_gpa_desktop:
    
    
        CreateShortCut "$DESKTOP\GPA Manual.lnk" \
                       "$INSTDIR\share\gpa\gpa.html" \
                       "" "" "" SW_SHOWNORMAL "" $(DESC_Menu_gpa_manual)
    
    no_desktop:
    
    
      # Check if the quick launch bar entries where requested.
      !insertmacro MUI_INSTALLOPTIONS_READ $R0 "inst-options.ini" \
    	"Field 4" "State"
      IntCmp $R0 0 no_quick_launch
      StrCmp $QUICKLAUNCH $TEMP no_quick_launch
    
        SectionGetFlags ${SEC_gpa} $R0
        IntOp $R0 $R0 & ${SF_SELECTED}
        IntCmp $R0 ${SF_SELECTED} 0 no_gpa_quicklaunch
        CreateShortCut "$QUICKLAUNCH\GPA.lnk" \
    	"$INSTDIR\bin\launch-gpa.exe" \
            "" "" "" SW_SHOWNORMAL "" $(DESC_Menu_gpa)
    no_gpa_quicklaunch:
    
    
    no_quick_launch:
    
    
    SectionEnd
    !endif
    
    
    #
    # Now for the generic parts to end the installation.
    #
    Var MYTMP
    
    # Last section is a hidden one.
    Section
      WriteUninstaller "$INSTDIR\gnupg-uninstall.exe"
    
      # Windows Add/Remove Programs support
      StrCpy $MYTMP "Software\Microsoft\Windows\CurrentVersion\Uninstall\GnuPG"
      WriteRegExpandStr SHCTX $MYTMP "UninstallString" '"$INSTDIR\gnupg-uninstall.exe"'
      WriteRegExpandStr SHCTX $MYTMP "InstallLocation" "$INSTDIR"
      WriteRegStr       SHCTX $MYTMP "DisplayName"     "${PRETTY_PACKAGE}"
    !ifdef WITH_GUI
      WriteRegStr       SHCTX $MYTMP "DisplayIcon"     "$INSTDIR\bin\gpa.exe,0"
    !else
      WriteRegStr       SHCTX $MYTMP "DisplayIcon"     "$INSTDIR\bin\gpg.exe,0"
    !endif
      WriteRegStr       SHCTX $MYTMP "DisplayVersion"  "${VERSION}"
      WriteRegStr       SHCTX $MYTMP "Publisher"       "The GnuPG Project"
      WriteRegStr       SHCTX $MYTMP "URLInfoAbout"    "https://gnupg.org"
      WriteRegDWORD     SHCTX $MYTMP "NoModify"        "1"
      WriteRegDWORD     SHCTX $MYTMP "NoRepair"        "1"
    SectionEnd
    
    Section Uninstall
    !ifdef WITH_GUI
      #---------------------------------------------------
      # Delete the menu entries and any empty parent menus
      #---------------------------------------------------
      !insertmacro MUI_STARTMENU_GETFOLDER Application $MYTMP
      Delete "$SMPROGRAMS\$MYTMP\GPA.lnk"
      Delete "$SMPROGRAMS\$MYTMP\GnuPG Manual.lnk"
      Delete "$SMPROGRAMS\$MYTMP\GnuPG README.lnk"
      Delete "$SMPROGRAMS\$MYTMP\*.lnk"
      StrCpy $MYTMP "$SMPROGRAMS\$MYTMP"
      startMenuDeleteLoop:
        ClearErrors
        RMDir $MYTMP
        GetFullPathName $MYTMP "$MYTMP\.."
        IfErrors startMenuDeleteLoopDone
        StrCmp $MYTMP $SMPROGRAMS startMenuDeleteLoopDone startMenuDeleteLoop
      startMenuDeleteLoopDone:
    
      DeleteRegValue SHCTX "Software\GNU\GnuPG" "Start Menu Folder"
    
      # Delete Desktop links.
      Delete "$DESKTOP\GPA.lnk"
      Delete "$DESKTOP\GnuPG Manual.lnk"
      Delete "$DESKTOP\GnuPG README.lnk"
    
      # Delete Quick Launch Bar links.
      StrCmp $QUICKLAUNCH $TEMP no_quick_launch_uninstall
      Delete "$QUICKLAUNCH\GPA.lnk"
    no_quick_launch_uninstall:
    
    !endif
    
      Delete "$INSTDIR\gnupg-uninstall.exe"
      RMDir "$INSTDIR"
    
      # Clean the registry.
      DeleteRegValue SHCTX "Software\GnuPG" "Install Directory"
      DeleteRegKey /ifempty SHCTX "Software\GnuPG"
      # Remove Windows Add/Remove Programs support.
      DeleteRegKey SHCTX "Software\Microsoft\Windows\CurrentVersion\Uninstall\GnuPG"
    SectionEnd