File: gtkmm-installer.nsi.in

package info (click to toggle)
gtkmm2.4 1:2.24.5-4
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 149,184 kB
  • sloc: xml: 80,438; cpp: 6,880; sh: 4,175; perl: 236; makefile: 230
file content (2154 lines) | stat: -rw-r--r-- 68,988 bytes parent folder | download | duplicates (4)
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
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
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
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154

; Title          gtkmm for win32 installer
; Author         Cedric Gustin <cedric.gustin@swing.be>

;    Copyright (C) 2004-2006  Cedric Gustin
;                  2008-2010  Armin Burgmeier
;
;    This program is free software; you can redistribute it and/or modify
;    it under the terms of the GNU General Public License as published by
;    the Free Software Foundation; either version 2 of the License, or
;    (at your option) any later version.
;
;    This program is distributed in the hope that it will be useful,
;    but WITHOUT ANY WARRANTY; without even the implied warranty of
;    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;    GNU General Public License for more details.
;
;    You should have received a copy of the GNU General Public License
;    along with this program; if not, write to the Free Software
;    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

;--------------------------------
; Settings

; !define RUNTIME_ONLY 1

!ifndef PRODUCT_VERSION_MAJOR
!define PRODUCT_VERSION_MAJOR "@GTKMM_MAJOR_VERSION@"
!endif
!ifndef PRODUCT_VERSION_MINOR
!define PRODUCT_VERSION_MINOR "@GTKMM_MINOR_VERSION@"
!endif
!ifndef PRODUCT_VERSION_MICRO
!define PRODUCT_VERSION_MICRO "@GTKMM_MICRO_VERSION@"
!endif
!ifndef PRODUCT_VERSION_INSTALLER
!define PRODUCT_VERSION_INSTALLER "2"
!endif

!ifdef PRODUCT_API_VERSION
!undef PRODUCT_API_VERSION
!endif

!define PRODUCT_API_VERSION "@GTKMM_API_VERSION@"

;--------------------------------
; Defines

!define PRODUCT_NAME "gtkmm"
; TODO: Should choose between gtkmm32 and gtkmm64 or somesuch when we can break compatibility (with gtkmm3 maybe)
!define PRODUCT_PLATFORM_NAME "gtkmm"
!define PRODUCT_SMNAME "Gtkmm"
!ifdef RUNTIME_ONLY
  !define PRODUCT_FULLNAME "gtkmm Runtime Environment"
!else
  !define PRODUCT_FULLNAME "gtkmm Development Environment"
!endif
!define PRODUCT_PUBLISHER "The gtkmm developers"
!define PRODUCT_WEB_SITE "http://www.gtkmm.org/"

!ifdef PRODUCT_VERSION
!undef PRODUCT_VERSION
!endif
!define PRODUCT_VERSION "@PACKAGE_VERSION@"

!ifdef RUNTIME_ONLY
  !define INSTALLER_NAME "${PRODUCT_NAME}-win32-runtime-${PRODUCT_VERSION}-${PRODUCT_VERSION_INSTALLER}.exe"
  !define BINDIR "bin_stripped"
!else
  !define INSTALLER_NAME "${PRODUCT_NAME}-win32-devel-${PRODUCT_VERSION}-${PRODUCT_VERSION_INSTALLER}.exe"
  !define BINDIR "bin"
!endif

!define GTKMM_REG_KEY	         "Software\gtkmm\${PRODUCT_API_VERSION}"
!define GTKMM_UNINSTALL_KEY	 "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_PLATFORM_NAME}"
!define GTKMM_UNINSTALL_EXE	 "gtkmm-uninst.exe"

;--------------------------------
; Installer Details

SetCompressor /SOLID lzma
ShowInstDetails hide
ShowUninstDetails hide
SetDateSave on
CRCCheck on
XPStyle on

;--------------------------------
; Standard Libraries

!include "MUI.nsh"
!include "Sections.nsh"
!include "StrFunc.nsh"
${StrTok} # Supportable for Install Sections and Functions

;--------------------------------
; Local Libraries

!addincludedir "NSISLibrary"
!include "PathManipulation.nsh"
;!include "DetectGTK.nsh"
!include "VersionCheck.nsh"
!include "CmdParameters.nsh"
!include "StringUtilities.nsh"

;--------------------------------
; Variables

Var CB_PATH_VALUE
Var ISADMIN
Var CONTEXT
Var ICONS_GROUP
Var FORCE_UNINSTALL
Var USE_GTKDIR

;--------------------------------
; MUI Settings

!define MUI_ABORTWARNING
!define MUI_ICON .\gtkmm.ico
!define MUI_UNICON .\gtkmm.ico

; Reserve space for InstallOptions
; Don't do it here as we want full extraction during the installer initialization
; ReserveFile "NSISLibrary\PathQuestion.ini"
; Reservefile "NSISLibrary\SetContext.ini"
; !insertmacro MUI_RESERVEFILE_INSTALLOPTIONS
; !insertmacro MUI_RESERVEFILE_LANGDLL

; Remember the installer language
!define MUI_LANGDLL_REGISTRY_ROOT "HKCU"
!define MUI_LANGDLL_REGISTRY_KEY "Software\${PRODUCT_PLATFORM_NAME}\${PRODUCT_API_VERSION}"
!define MUI_LANGDLL_REGISTRY_VALUENAME "Installer Language"

!define MUI_CUSTOMFUNCTION_GUIINIT CustomPreviousVersion
!define MUI_PAGE_CUSTOMFUNCTION_PRE EnableGTKInstaller
!define MUI_PAGE_CUSTOMFUNCTION_LEAVE DisableGTKInstaller
!insertmacro MUI_PAGE_INSTFILES
!define MUI_WELCOMEPAGE_TITLE_3LINES
!insertmacro MUI_PAGE_WELCOME
; !define MUI_LICENSEPAGE_RADIOBUTTONS
!insertmacro MUI_PAGE_LICENSE "lgpl.txt"
Page custom CustomPageSetContext
!define MUI_PAGE_CUSTOMFUNCTION_PRE CustomSetTargetDirectory
!define MUI_DIRECTORYPAGE_TEXT_TOP  "$(GTKMM_DIRECTORYPAGE_HINT)"
!insertmacro MUI_PAGE_DIRECTORY
Page custom CustomPagePathQuestion
!ifndef RUNTIME_ONLY
  !insertmacro MUI_PAGE_COMPONENTS
!endif
!define MUI_STARTMENUPAGE_NODISABLE
!define MUI_STARTMENUPAGE_DEFAULTFOLDER "Gtkmm";
!define MUI_STARTMENUPAGE_REGISTRY_ROOT "HKLM"
!define MUI_STARTMENUPAGE_REGISTRY_KEY "${GTKMM_UNINSTALL_KEY}"
!define MUI_STARTMENUPAGE_REGISTRY_VALUENAME "NSIS:StartMenuDir"
!insertmacro MUI_PAGE_STARTMENU Application $ICONS_GROUP
!insertmacro MUI_PAGE_INSTFILES
!define MUI_FINISHPAGE_TITLE_3LINES
!insertmacro MUI_PAGE_FINISH

!define MUI_WELCOMEPAGE_TITLE_3LINES
!insertmacro MUI_UNPAGE_WELCOME
!insertmacro MUI_UNPAGE_INSTFILES
!define MUI_FINISHPAGE_TITLE_3LINES
!insertmacro MUI_UNPAGE_FINISH

;--------------------------------
; Languages

!insertmacro MUI_LANGUAGE "English"
!insertmacro MUI_LANGUAGE "French"
!insertmacro MUI_LANGUAGE "SimpChinese"

!include "translations\english.nsh"
!include "translations\french.nsh"
!include "translations\simpchinese.nsh"

;--------------------------------
; General Installer Options

Name "${PRODUCT_FULLNAME} ${PRODUCT_VERSION}"
OutFile "${INSTALLER_NAME}"
;InstallDir "$PROGRAMFILES\${PRODUCT_NAME}"
; Use a default path which has no spaces in it, pkg-config fails otherwise.
; see http://lists.freedesktop.org/archives/pkg-config/2007-September/000224.html
InstallDir "C:\${PRODUCT_PLATFORM_NAME}"
; Get installation folder from registry if available
InstallDirRegKey HKLM Software\${PRODUCT_PLATFORM_NAME}\${PRODUCT_API_VERSION} "Path"

;--------------------------------
; Installer Sections

!ifndef RUNTIME_ONLY
  InstType "Full"
  InstType "Runtime only"
!endif

;Section -installgtk SecGTKInstaller
; 
;  Push ${GTK_VERSION}
;  Call CheckGTKRuntime
; 
;SectionEnd

SubSection "GTK+"

Section "Runtime" SecGTKRuntime
!ifndef RUNTIME_ONLY
  SectionIn 1 2 RO
!else
  SectionIn RO
!endif
  SetOverwrite ifnewer

  SetOutPath $INSTDIR\bin

  File ${BINDIR}\libgcc_s_sjlj-1.dll

  ; These break when stripped, therefore we always load them from bin/
  File bin\zlib1.dll
  File bin\intl.dll
;  File bin\charset.dll
;  File bin\iconv.dll

  File ${BINDIR}\libxml2-2.dll
;  File ${BINDIR}\libjpeg-7.dll
  File ${BINDIR}\libpng14-14.dll
;  File ${BINDIR}\libtiff-3.dll
  File ${BINDIR}\freetype6.dll
  File ${BINDIR}\libexpat-1.dll
  File ${BINDIR}\libfontconfig-1.dll
  File ${BINDIR}\libglib-2.0-0.dll
  File ${BINDIR}\libgobject-2.0-0.dll
  File ${BINDIR}\libgmodule-2.0-0.dll
  File ${BINDIR}\libgthread-2.0-0.dll
  File ${BINDIR}\libgio-2.0-0.dll
  File ${BINDIR}\libcairo-2.dll
  File ${BINDIR}\libatk-1.0-0.dll
  File ${BINDIR}\libpango-1.0-0.dll
  File ${BINDIR}\libpangocairo-1.0-0.dll
  File ${BINDIR}\libpangoft2-1.0-0.dll
  File ${BINDIR}\libpangowin32-1.0-0.dll
  File ${BINDIR}\libgailutil-18.dll
  File ${BINDIR}\libgdk-win32-2.0-0.dll
  File ${BINDIR}\libgdk_pixbuf-2.0-0.dll
  File ${BINDIR}\libgtk-win32-2.0-0.dll
  File ${BINDIR}\libglade-2.0-0.dll
  File ${BINDIR}\gspawn-win32-helper.exe
  File ${BINDIR}\gspawn-win32-helper-console.exe
  File ${BINDIR}\gtk-update-icon-cache.exe
  File ${BINDIR}\gtk-demo.exe

  SetOutPath $INSTDIR\lib\gtk-2.0\2.10.0
  File /r lib\gtk-2.0\2.10.0\engines
  SetOutPath $INSTDIR\lib\gdk-pixbuf-2.0\2.10.0
  File /r lib\gdk-pixbuf-2.0\2.10.0\loaders

  SetOutPath $INSTDIR\lib\gtk-2.0
  File /r lib\gtk-2.0\modules

  SetOutPath $INSTDIR\etc
  File /r etc\gtk-2.0
  File /r etc\pango

  ; TODO: Add others... libiconv, fontconfig, libxml2, tiff... however note
  ; that some contain devel-only things.
  SetOutPath $INSTDIR\share\doc
  File /r share\doc\glib-2.26.0
  File /r share\doc\cairo_1.10.0-1_win32
  File /r share\doc\pango-1.28.3
  File /r share\doc\gtk+-2.22.0

  SetOutPath $INSTDIR\share
  File /r share\locale
  File /r share\themes
; Only required for gtk-demo:
  File /r share\gtk-2.0

!ifndef RUNTIME_ONLY
  SetOutPath $INSTDIR\redist

  File bin_stripped\libgcc_s_sjlj-1.dll

  ; These are broken when stripped:
  File bin\zlib1.dll
  File bin\intl.dll
;  File bin\charset.dll
;  File bin\iconv.dll

  File bin_stripped\libxml2-2.dll
;  File bin_stripped\libjpeg-7.dll
  File bin_stripped\libpng14-14.dll
;  File bin_stripped\libtiff-3.dll
  File bin_stripped\freetype6.dll
  File bin_stripped\libexpat-1.dll
  File bin_stripped\libfontconfig-1.dll
  File bin_stripped\libglib-2.0-0.dll
  File bin_stripped\libgobject-2.0-0.dll
  File bin_stripped\libgmodule-2.0-0.dll
  File bin_stripped\libgthread-2.0-0.dll
  File bin_stripped\libgio-2.0-0.dll
  File bin_stripped\libcairo-2.dll
  File bin_stripped\libatk-1.0-0.dll
  File bin_stripped\libpango-1.0-0.dll
  File bin_stripped\libpangocairo-1.0-0.dll
  File bin_stripped\libpangoft2-1.0-0.dll
  File bin_stripped\libpangowin32-1.0-0.dll
  File bin_stripped\libgailutil-18.dll
  File bin_stripped\libgdk-win32-2.0-0.dll
  File bin_stripped\libgdk_pixbuf-2.0-0.dll
  File bin_stripped\libgtk-win32-2.0-0.dll
  File bin_stripped\libglade-2.0-0.dll
  File bin_stripped\gspawn-win32-helper.exe
  File bin_stripped\gspawn-win32-helper-console.exe
!endif

SectionEnd

!ifndef RUNTIME_ONLY
Section "Development" SecGTKDevelopment
  SectionIn 1
  SetOverwrite ifnewer

  SetOutPath $INSTDIR\bin

  ; Again, we always use the non-stripped version here since stripping breaks it
;  File bin\iconv.exe

  ; These are only useful to developers
  File ${BINDIR}\pkg-config.exe
  File ${BINDIR}\glib-genmarshal.exe
  File ${BINDIR}\glib-gettextize
  File ${BINDIR}\glib-mkenums
  File ${BINDIR}\gobject-query.exe
  File ${BINDIR}\pango-querymodules.exe
  File ${BINDIR}\gdk-pixbuf-csource.exe
  File ${BINDIR}\gdk-pixbuf-query-loaders.exe
  File ${BINDIR}\gtk-builder-convert
  File ${BINDIR}\gtk-query-immodules-2.0.exe

  SetOutPath $INSTDIR\include
  File /r include\libxml2
  File /r include\freetype2
  File /r include\fontconfig
  File /r include\libpng14
  File /r include\glib-2.0
  File /r include\cairo
  File /r include\atk-1.0
  File /r include\pango-1.0
  File /r include\gdk-pixbuf-2.0
  File /r include\gtk-2.0
  File /r include\libglade-2.0
  File /r include\gail-1.0

  File include\expat.h
  File include\expat_external.h
  File include\ft2build.h
;  File include\iconv.h
;  File include\jconfig.h
;  File include\jerror.h
;  File include\jmorecfg.h
;  File include\jpeglib.h
;  File include\libcharset.h
;  File include\localcharset.h
  File include\libintl.h
  File include\png.h
  File include\pngconf.h
;  File include\tiff.h
;  File include\tiffconf.h
;  File include\tiffio.h
;  File include\tiffvers.h
  File include\zconf.h
  File include\zlib.h

  SetOutPath $INSTDIR\lib\gtk-2.0
  File /r lib\gtk-2.0\include

  SetOutPath $INSTDIR\lib\glib-2.0
  File /r lib\glib-2.0\include

  SetOutPath $INSTDIR\lib\gtk-2.0
  File /r lib\gtk-2.0\include

  SetOutPath $INSTDIR\lib
  File lib\libxml2.lib
  File lib\libxml2.dll.a
;  File lib\charset.lib
;  File lib\iconv.lib
;  File lib\libiconv.a
  File lib\libintl.def
  File lib\intl.lib
  File lib\libintl.dll.a
;  File lib\libtiff.def Is no longer provided by the bundle since 2.16.6
;  File lib\libtiff.lib Is no longer provided by the bundle since 2.16.6
;  File lib\libtiff.dll.a
  File lib\libpng.def
  File lib\libpng.lib
  File lib\libpng14.dll.a
  File lib\zlib.def
  File lib\zdll.lib
  File lib\libz.dll.a
  File lib\libfreetype.dll.a
  File lib\libexpat.def
  File lib\expat.lib
  File lib\libexpat.dll.a
  File lib\fontconfig.def
  File lib\fontconfig.lib
  File lib\libfontconfig.dll.a
  File lib\glib-2.0.def
  File lib\glib-2.0.lib
  File lib\libglib-2.0.dll.a
  File lib\gobject-2.0.def
  File lib\gobject-2.0.lib
  File lib\libgobject-2.0.dll.a
  File lib\gmodule-2.0.def
  File lib\gmodule-2.0.lib
  File lib\libgmodule-2.0.dll.a
  File lib\gthread-2.0.def
  File lib\gthread-2.0.lib
  File lib\libgthread-2.0.dll.a
  File lib\gio-2.0.def
  File lib\gio-2.0.lib
  File lib\libgio-2.0.dll.a
  File lib\cairo.def
  File lib\cairo.lib
  File lib\libcairo.dll.a
  File lib\atk-1.0.def
  File lib\atk-1.0.lib
  File lib\libatk-1.0.dll.a
  File lib\pango-1.0.def
  File lib\pango-1.0.lib
  File lib\libpango-1.0.dll.a
  File lib\pangocairo-1.0.def
  File lib\pangocairo-1.0.lib
  File lib\libpangocairo-1.0.dll.a
  File lib\pangoft2-1.0.def
  File lib\pangoft2-1.0.lib
  File lib\libpangoft2-1.0.dll.a
  File lib\pangowin32-1.0.def
  File lib\pangowin32-1.0.lib
  File lib\libpangowin32-1.0.dll.a
  File lib\gailutil.lib
  File lib\libgailutil.dll.a
; TODO: What about .defs here?
  File lib\gdk-win32-2.0.lib
  File lib\libgdk-win32-2.0.dll.a
  File lib\gdk_pixbuf-2.0.lib
  File lib\libgdk_pixbuf-2.0.dll.a
  File lib\gtk-win32-2.0.lib
  File lib\libgtk-win32-2.0.dll.a
  File lib\glade-2.0.lib
  File lib\libglade-2.0.dll.a

  SetOutPath $INSTDIR\lib\pkgconfig
  File lib\pkgconfig\libxml-2.0.pc
  File lib\pkgconfig\libpng.pc
  File lib\pkgconfig\libpng14.pc
  File lib\pkgconfig\freetype2.pc
  File lib\pkgconfig\fontconfig.pc
  File lib\pkgconfig\glib-2.0.pc
  File lib\pkgconfig\gmodule-2.0.pc
  File lib\pkgconfig\gmodule-no-export-2.0.pc
  File lib\pkgconfig\gobject-2.0.pc
  File lib\pkgconfig\gthread-2.0.pc
  File lib\pkgconfig\gio-2.0.pc
  File lib\pkgconfig\cairo.pc
  File lib\pkgconfig\cairo-png.pc
  File lib\pkgconfig\cairo-pdf.pc
  File lib\pkgconfig\cairo-ps.pc
  File lib\pkgconfig\cairo-svg.pc
  File lib\pkgconfig\cairo-win32.pc
  File lib\pkgconfig\cairo-win32-font.pc
  File lib\pkgconfig\atk.pc
  File lib\pkgconfig\pango.pc
  File lib\pkgconfig\pangocairo.pc
  File lib\pkgconfig\pangoft2.pc
  File lib\pkgconfig\pangowin32.pc
  File lib\pkgconfig\gdk-2.0.pc
  File lib\pkgconfig\gdk-pixbuf-2.0.pc
  File lib\pkgconfig\gdk-win32-2.0.pc
  File lib\pkgconfig\gtk+-2.0.pc
  File lib\pkgconfig\gtk+-win32-2.0.pc
  File lib\pkgconfig\libglade-2.0.pc
  File lib\pkgconfig\gail.pc

  SetOutPath $INSTDIR\share\doc
  File /r share\doc\glib-dev-2.26.0
  File /r share\doc\pango-dev-1.28.3
  File /r share\doc\gtk+-dev-2.22.0

  SetOutPath $INSTDIR\share\xml
  File /r share\xml\libglade

  SetOutPath $INSTDIR\share
  File /r share\glib-2.0

  SetOutPath $INSTDIR\share\aclocal
  File share\aclocal\libxml.m4
  File share\aclocal\freetype2.m4
  File share\aclocal\glib-2.0.m4
  File share\aclocal\glib-gettext.m4
  File share\aclocal\gtk-2.0.m4
  File share\aclocal\pkg.m4
SectionEnd

Section "Documentation" SecGTKDocumentation
  SectionIn 1
  SetOverwrite ifnewer
  
;  SetOutPath $INSTDIR\share\doc
;  File /r share\doc\libiconv

  SetOutPath $INSTDIR\share\gtk-doc\html
  File /r share\gtk-doc\html\libxml2
  File /r share\gtk-doc\html\glib
  File /r share\gtk-doc\html\gobject
  File /r share\gtk-doc\html\cairo
  File /r share\gtk-doc\html\pango
  File /r share\gtk-doc\html\gdk
  File /r share\gtk-doc\html\gdk-pixbuf
  File /r share\gtk-doc\html\gtk
  File /r share\gtk-doc\html\libglade
  File /r share\gtk-doc\html\gail-libgail-util

SectionEnd
!endif

SubSectionEnd 

SubSection "libsigc++"

Section "Runtime" SecSigcRuntime
!ifndef RUNTIME_ONLY
  SectionIn 1 2 RO
!else
  SectionIn RO
!endif
  SetOverwrite ifnewer
  
  SetOutPath $INSTDIR\bin
  File ${BINDIR}\libsigc-2.0-0.dll
  File MSVC\sigc-vc80-2_0.dll
  File MSVC\sigc-vc90-2_0.dll
  File MSVC\sigc-vc100-2_0.dll
  !ifndef RUNTIME_ONLY
    File MSVC\sigc-vc80-d-2_0.dll
    File MSVC\sigc-vc90-d-2_0.dll
    File MSVC\sigc-vc100-d-2_0.dll
    File MSVC\sigc-vc80-d-2_0.pdb
    File MSVC\sigc-vc90-d-2_0.pdb
    File MSVC\sigc-vc100-d-2_0.pdb

    SetOutPath $INSTDIR\redist
    File bin_stripped\libsigc-2.0-0.dll
  !endif
  
SectionEnd

!ifndef RUNTIME_ONLY
Section "Development" SecSigcDevelopment
  SectionIn 1
  SetOverwrite ifnewer

  SetOutPath $INSTDIR\include
  File /r include\sigc++-2.0

  SetOutPath $INSTDIR\lib
  File lib\libsigc-2.0.dll.a
  File /r lib\sigc++-2.0
  File MSVC\sigc-vc80-2_0.lib
  File MSVC\sigc-vc90-2_0.lib
  File MSVC\sigc-vc100-2_0.lib
  File MSVC\sigc-vc80-d-2_0.lib
  File MSVC\sigc-vc90-d-2_0.lib
  File MSVC\sigc-vc100-d-2_0.lib
  
  SetOutPath $INSTDIR\lib\pkgconfig
  File lib\pkgconfig\sigc++-2.0.pc

SectionEnd

Section "Documentation" SecSigcDocumentation
  SectionIn 1
  SetOverwrite ifnewer
  
  SetOutPath $INSTDIR\share\doc
  
  File /r share\doc\libsigc++-2.0
  
SectionEnd
!endif

SubSectionEnd

SubSection "cairomm"

Section "Runtime" SecCairommRuntime
!ifndef RUNTIME_ONLY
  SectionIn 1 2 RO
!else
  SectionIn RO
!endif
  SetOverwrite ifnewer

  SetOutPath $INSTDIR\bin
  File ${BINDIR}\libcairomm-1.0-1.dll
  File MSVC\cairomm-vc80-1_0.dll
  File MSVC\cairomm-vc90-1_0.dll
  File MSVC\cairomm-vc100-1_0.dll
  !ifndef RUNTIME_ONLY
    File MSVC\cairomm-vc80-d-1_0.dll
    File MSVC\cairomm-vc90-d-1_0.dll
    File MSVC\cairomm-vc100-d-1_0.dll
    File MSVC\cairomm-vc80-d-1_0.pdb
    File MSVC\cairomm-vc90-d-1_0.pdb
    File MSVC\cairomm-vc100-d-1_0.pdb

    SetOutPath $INSTDIR\redist
    File bin_stripped\libcairomm-1.0-1.dll
  !endif
  
SectionEnd

!ifndef RUNTIME_ONLY
Section "Development" SecCairommDevelopment
  SectionIn 1
  SetOverwrite ifnewer

  SetOutPath $INSTDIR\include
  File /r include\cairomm-1.0

  SetOutPath $INSTDIR\lib
  File /r lib\cairomm-1.0
  File lib\libcairomm-1.0.dll.a
  File MSVC\cairomm-vc80-1_0.lib
  File MSVC\cairomm-vc90-1_0.lib
  File MSVC\cairomm-vc100-1_0.lib
  File MSVC\cairomm-vc80-d-1_0.lib
  File MSVC\cairomm-vc90-d-1_0.lib
  File MSVC\cairomm-vc100-d-1_0.lib

  SetOutPath $INSTDIR\lib\pkgconfig
  File lib\pkgconfig\cairomm-1.0.pc
  
SectionEnd

Section "Documentation" SecCairommDocumentation
  SectionIn 1
  SetOverwrite ifnewer

  SetOutPath $INSTDIR\share\doc
  File /r share\doc\cairomm-1.0

SectionEnd
!endif

SubSectionEnd

SubSection "glibmm"

Section "Runtime" SecGlibmmRuntime
!ifndef RUNTIME_ONLY
  SectionIn 1 2 RO
!else
  SectionIn RO
!endif
  SetOverwrite ifnewer

  SetOutPath $INSTDIR\bin
  File ${BINDIR}\libglibmm-2.4-1.dll
  File ${BINDIR}\libgiomm-2.4-1.dll
  File ${BINDIR}\libglibmm_generate_extra_defs-2.4-1.dll
  File MSVC\glibmm-vc80-2_4.dll
  File MSVC\glibmm-vc90-2_4.dll
  File MSVC\glibmm-vc100-2_4.dll
  File MSVC\giomm-vc80-2_4.dll
  File MSVC\giomm-vc90-2_4.dll
  File MSVC\giomm-vc100-2_4.dll
  !ifndef RUNTIME_ONLY
    File MSVC\glibmm-vc80-d-2_4.dll
    File MSVC\glibmm-vc90-d-2_4.dll
    File MSVC\glibmm-vc100-d-2_4.dll
    File MSVC\glibmm-vc80-d-2_4.pdb
    File MSVC\glibmm-vc90-d-2_4.pdb
    File MSVC\glibmm-vc100-d-2_4.pdb
    File MSVC\giomm-vc80-d-2_4.dll
    File MSVC\giomm-vc90-d-2_4.dll
    File MSVC\giomm-vc100-d-2_4.dll
    File MSVC\giomm-vc80-d-2_4.pdb
    File MSVC\giomm-vc90-d-2_4.pdb
    File MSVC\giomm-vc100-d-2_4.pdb

    SetOutPath $INSTDIR\redist
    File bin_stripped\libglibmm-2.4-1.dll
    File bin_stripped\libgiomm-2.4-1.dll
  !endif
  
SectionEnd

!ifndef RUNTIME_ONLY
Section "Development" SecGlibmmDevelopment
  SectionIn 1
  SetOverwrite ifnewer

  SetOutPath $INSTDIR\include
  File /r include\glibmm-2.4
  File /r include\giomm-2.4

  SetOutPath $INSTDIR\lib
  File lib\libglibmm-2.4.dll.a
  File lib\libgiomm-2.4.dll.a
  File lib\libglibmm_generate_extra_defs-2.4.dll.a
  File /r lib\glibmm-2.4
  File /r lib\giomm-2.4
  File MSVC\glibmm-vc80-2_4.lib
  File MSVC\glibmm-vc90-2_4.lib
  File MSVC\glibmm-vc100-2_4.lib
  File MSVC\glibmm-vc80-d-2_4.lib
  File MSVC\glibmm-vc90-d-2_4.lib
  File MSVC\glibmm-vc100-d-2_4.lib
  File MSVC\giomm-vc80-2_4.lib
  File MSVC\giomm-vc90-2_4.lib
  File MSVC\giomm-vc100-2_4.lib
  File MSVC\giomm-vc80-d-2_4.lib
  File MSVC\giomm-vc90-d-2_4.lib
  File MSVC\giomm-vc100-d-2_4.lib

  SetOutPath $INSTDIR\lib\pkgconfig
  File lib\pkgconfig\glibmm-2.4.pc
  File lib\pkgconfig\giomm-2.4.pc
  
  SetOutPath $INSTDIR\share\aclocal
  File share\aclocal\glibmm_check_perl.m4
  
SectionEnd

Section "Documentation" SecGlibmmDocumentation
  SectionIn 1
  SetOverwrite ifnewer

  SetOutPath $INSTDIR\share\doc
  File /r share\doc\glibmm-2.4

;  SetOutPath $INSTDIR\share\devhelp\books
;  File /r share\devhelp\books\glibmm-2.4
SectionEnd
!endif

SubSectionEnd

SubSection "pangomm"

Section "Runtime" SecPangommRuntime
!ifndef RUNTIME_ONLY
  SectionIn 1 2 RO
!else
  SectionIn RO
!endif
  SetOverwrite ifnewer

  SetOutPath $INSTDIR\bin
  File ${BINDIR}\libpangomm-1.4-1.dll
  File MSVC\pangomm-vc80-1_4.dll
  File MSVC\pangomm-vc90-1_4.dll
  File MSVC\pangomm-vc100-1_4.dll

  !ifndef RUNTIME_ONLY
    File MSVC\pangomm-vc80-d-1_4.dll
    File MSVC\pangomm-vc90-d-1_4.dll
    File MSVC\pangomm-vc100-d-1_4.dll
    File MSVC\pangomm-vc80-d-1_4.pdb
    File MSVC\pangomm-vc90-d-1_4.pdb
    File MSVC\pangomm-vc100-d-1_4.pdb

    SetOutPath $INSTDIR\redist
    File bin_stripped\libpangomm-1.4-1.dll
  !endif

SectionEnd

!ifndef RUNTIME_ONLY
Section "Development" SecPangommDevelopment
  SectionIn 1
  SetOverwrite ifnewer

  SetOutPath $INSTDIR\include
  File /r include\pangomm-1.4

  SetOutPath $INSTDIR\lib
  File lib\libpangomm-1.4.dll.a
  File /r lib\pangomm-1.4
  
  File MSVC\pangomm-vc80-1_4.lib
  File MSVC\pangomm-vc90-1_4.lib
  File MSVC\pangomm-vc100-1_4.lib
  File MSVC\pangomm-vc80-d-1_4.lib
  File MSVC\pangomm-vc90-d-1_4.lib
  File MSVC\pangomm-vc100-d-1_4.lib

  SetOutPath $INSTDIR\lib\pkgconfig
  File lib\pkgconfig\pangomm-1.4.pc
  
SectionEnd

Section "Documentation" SecPangommDocumentation
  SectionIn 1
  SetOverwrite ifnewer

  SetOutPath $INSTDIR\share\doc
  File /r share\doc\pangomm-1.4

  SetOutPath $INSTDIR\share\devhelp\books
  File /r share\devhelp\books\pangomm-1.4

SectionEnd
!endif

SubSectionEnd

SubSection "atkmm"

Section "Runtime" SecAtkmmRuntime
!ifndef RUNTIME_ONLY
  SectionIn 1 2 RO
!else
  SectionIn RO
!endif
  SetOverwrite ifnewer

  SetOutPath $INSTDIR\bin
  File ${BINDIR}\libatkmm-1.6-1.dll
  File MSVC\atkmm-vc80-1_6.dll
  File MSVC\atkmm-vc90-1_6.dll
  File MSVC\atkmm-vc100-1_6.dll

  !ifndef RUNTIME_ONLY
    File MSVC\atkmm-vc80-d-1_6.dll
    File MSVC\atkmm-vc90-d-1_6.dll
    File MSVC\atkmm-vc100-d-1_6.dll
    File MSVC\atkmm-vc80-d-1_6.pdb
    File MSVC\atkmm-vc90-d-1_6.pdb
    File MSVC\atkmm-vc100-d-1_6.pdb

    SetOutPath $INSTDIR\redist
    File bin_stripped\libatkmm-1.6-1.dll
  !endif

SectionEnd

!ifndef RUNTIME_ONLY
Section "Development" SecAtkmmDevelopment
  SectionIn 1
  SetOverwrite ifnewer

  SetOutPath $INSTDIR\include
  File /r include\atkmm-1.6

  SetOutPath $INSTDIR\lib
  File lib\libatkmm-1.6.dll.a
  File /r lib\atkmm-1.6
  
  File MSVC\atkmm-vc80-1_6.lib
  File MSVC\atkmm-vc90-1_6.lib
  File MSVC\atkmm-vc100-1_6.lib
  File MSVC\atkmm-vc80-d-1_6.lib
  File MSVC\atkmm-vc90-d-1_6.lib
  File MSVC\atkmm-vc100-d-1_6.lib

  SetOutPath $INSTDIR\lib\pkgconfig
  File lib\pkgconfig\atkmm-1.6.pc
  
SectionEnd

Section "Documentation" SecAtkmmDocumentation
  SectionIn 1
  SetOverwrite ifnewer

  SetOutPath $INSTDIR\share\doc
  File /r share\doc\atkmm-1.6

  SetOutPath $INSTDIR\share\devhelp\books
  File /r share\devhelp\books\atkmm-1.6

SectionEnd
!endif

SubSectionEnd

SubSection "gtkmm"

Section "Runtime" SecGtkmmRuntime
!ifndef RUNTIME_ONLY
  SectionIn 1 2 RO
!else
  SectionIn RO
!endif
  SetOverwrite ifnewer

  SetOutPath $INSTDIR\bin
  File ${BINDIR}\libgdkmm-2.4-1.dll
  File ${BINDIR}\libgtkmm-2.4-1.dll

  File MSVC\gdkmm-vc80-2_4.dll
  File MSVC\gdkmm-vc90-2_4.dll
  File MSVC\gdkmm-vc100-2_4.dll
  File MSVC\gtkmm-vc80-2_4.dll
  File MSVC\gtkmm-vc90-2_4.dll
  File MSVC\gtkmm-vc100-2_4.dll

  !ifndef RUNTIME_ONLY
    File MSVC\gdkmm-vc80-d-2_4.dll
    File MSVC\gdkmm-vc90-d-2_4.dll
    File MSVC\gdkmm-vc100-d-2_4.dll
    File MSVC\gdkmm-vc80-d-2_4.pdb
    File MSVC\gdkmm-vc90-d-2_4.pdb
    File MSVC\gdkmm-vc100-d-2_4.pdb
    File MSVC\gtkmm-vc80-d-2_4.dll
    File MSVC\gtkmm-vc90-d-2_4.dll
    File MSVC\gtkmm-vc100-d-2_4.dll
    File MSVC\gtkmm-vc80-d-2_4.pdb
    File MSVC\gtkmm-vc90-d-2_4.pdb
    File MSVC\gtkmm-vc100-d-2_4.pdb

    SetOutPath $INSTDIR\redist
    File bin_stripped\libgdkmm-2.4-1.dll
    File bin_stripped\libgtkmm-2.4-1.dll
  !endif
  
SectionEnd

!ifndef RUNTIME_ONLY
Section "Development" SecGtkmmDevelopment
  SectionIn 1
  SetOverwrite ifnewer

  SetOutPath $INSTDIR\include
  File /r include\gtkmm-2.4
  File /r include\gdkmm-2.4

  SetOutPath $INSTDIR\lib
  File lib\libgdkmm-2.4.dll.a
  File lib\libgtkmm-2.4.dll.a
  File /r lib\gtkmm-2.4
  File /r lib\gdkmm-2.4
  
  File MSVC\gdkmm-vc80-2_4.lib
  File MSVC\gdkmm-vc90-2_4.lib
  File MSVC\gdkmm-vc100-2_4.lib
  File MSVC\gdkmm-vc80-d-2_4.lib
  File MSVC\gdkmm-vc90-d-2_4.lib
  File MSVC\gdkmm-vc100-d-2_4.lib
  File MSVC\gtkmm-vc80-2_4.lib
  File MSVC\gtkmm-vc90-2_4.lib
  File MSVC\gtkmm-vc100-2_4.lib
  File MSVC\gtkmm-vc80-d-2_4.lib
  File MSVC\gtkmm-vc90-d-2_4.lib
  File MSVC\gtkmm-vc100-d-2_4.lib

  SetOutPath $INSTDIR\lib\pkgconfig
  File lib\pkgconfig\gdkmm-2.4.pc
  File lib\pkgconfig\gtkmm-2.4.pc
  
  SetOutPath $INSTDIR\MSVC
  File MSVC\gtkmm-vc80-2_4.vsprops
  File MSVC\gtkmm-vc90-2_4.vsprops
  File MSVC\gtkmm-vc100-2_4.props
  File MSVC\gtkmm-vc80-d-2_4.vsprops
  File MSVC\gtkmm-vc90-d-2_4.vsprops
  File MSVC\gtkmm-vc100-d-2_4.props
  File MSVC\gtkmm-2.4.vsprops
  File MSVC\gtkmm-2.4d.vsprops

SectionEnd

Section "Demo" SecGtkmmDemo
  SectionIn 1
  SetOverwrite ifnewer

  SetOutPath $INSTDIR\gtkmm-demo
  File demo\gtkmm-demo.exe
  File demo\*.cc
  File demo\*.png
  File demo\*.jpg
  File demo\*.gif

SectionEnd

Section "Documentation" SecGtkmmDocumentation
  SectionIn 1
  SetOverwrite ifnewer

  SetOutPath $INSTDIR\share\doc
  File /r share\doc\gtkmm-2.4

  SetOutPath $INSTDIR\share\devhelp\books
  File /r share\devhelp\books\gtkmm-2.4

SectionEnd
!endif

SubSectionEnd

SubSection "libglademm"

Section "Runtime" SecLibglademmRuntime
!ifndef RUNTIME_ONLY
  SectionIn 1 2
!endif
  SetOverwrite ifnewer

  SetOutPath $INSTDIR\bin
  File ${BINDIR}\libglademm-2.4-1.dll
  File MSVC\glademm-vc80-2_4.dll
  File MSVC\glademm-vc90-2_4.dll
  File MSVC\glademm-vc100-2_4.dll
  !ifndef RUNTIME_ONLY
    File MSVC\glademm-vc80-d-2_4.dll
    File MSVC\glademm-vc90-d-2_4.dll
    File MSVC\glademm-vc100-d-2_4.dll
    File MSVC\glademm-vc80-d-2_4.pdb
    File MSVC\glademm-vc90-d-2_4.pdb
    File MSVC\glademm-vc100-d-2_4.pdb

    SetOutPath $INSTDIR\redist
    File bin_stripped\libglademm-2.4-1.dll
  !endif
  
SectionEnd

!ifndef RUNTIME_ONLY
Section "Development" SecLibglademmDevelopment
  SectionIn 1
  SetOverwrite ifnewer

  SetOutPath $INSTDIR\include
  File /r include\libglademm-2.4

  SetOutPath $INSTDIR\lib
  File lib\libglademm-2.4.dll.a
  File /r lib\libglademm-2.4
  File MSVC\glademm-vc80-2_4.lib
  File MSVC\glademm-vc90-2_4.lib
  File MSVC\glademm-vc100-2_4.lib
  File MSVC\glademm-vc80-d-2_4.lib
  File MSVC\glademm-vc90-d-2_4.lib
  File MSVC\glademm-vc100-d-2_4.lib

  SetOutPath $INSTDIR\lib\pkgconfig
  File lib\pkgconfig\libglademm-2.4.pc

SectionEnd

Section "Documentation" SecLibglademmDocumentation
  SectionIn 1
  SetOverwrite ifnewer

  SetOutPath $INSTDIR\share\doc\gnomemm-2.6
  File /r share\doc\gnomemm-2.6\libglademm-2.4
  
  SetOutPath $INSTDIR\share\devhelp\books
  File /r share\devhelp\books\libglademm-2.4

SectionEnd
!endif

SubSectionEnd

SubSection "libxml++"

Section "Runtime" SecLibxmlRuntime
!ifndef RUNTIME_ONLY
  SectionIn 1 2
!endif
  SetOverwrite ifnewer

  SetOutPath $INSTDIR\bin
  File ${BINDIR}\libxml++-2.6-2.dll
  File MSVC\xml++-vc80-2_6.dll
  File MSVC\xml++-vc90-2_6.dll
  File MSVC\xml++-vc100-2_6.dll
  !ifndef RUNTIME_ONLY
    File MSVC\xml++-vc80-d-2_6.dll
    File MSVC\xml++-vc90-d-2_6.dll
    File MSVC\xml++-vc100-d-2_6.dll
    File MSVC\xml++-vc80-d-2_6.pdb
    File MSVC\xml++-vc90-d-2_6.pdb
    File MSVC\xml++-vc100-d-2_6.pdb

    SetOutPath $INSTDIR\redist
    File bin_stripped\libxml++-2.6-2.dll
  !endif

SectionEnd

!ifndef RUNTIME_ONLY
Section "Development" SecLibxmlDevelopment
  SectionIn 1
  SetOverwrite ifnewer

  SetOutPath $INSTDIR\include
  File /r include\libxml++-2.6

  SetOutPath $INSTDIR\lib
  File lib\libxml++-2.6.dll.a
  File /r lib\libxml++-2.6
  File MSVC\xml++-vc80-2_6.lib
  File MSVC\xml++-vc90-2_6.lib
  File MSVC\xml++-vc100-2_6.lib
  File MSVC\xml++-vc80-d-2_6.lib
  File MSVC\xml++-vc90-d-2_6.lib
  File MSVC\xml++-vc100-d-2_6.lib

  SetOutPath $INSTDIR\lib\pkgconfig
  File lib\pkgconfig\libxml++-2.6.pc

SectionEnd

Section "Documentation" SecLibxmlDocumentation
  SectionIn 1
  SetOverwrite ifnewer

  SetOutPath $INSTDIR\share\doc
  File /r share\doc\libxml++-2.6

SectionEnd
!endif

SubSectionEnd

Section -Post SecPost

  Strcmp $ISADMIN "1" 0 +3
    IfSilent +2
      !insertmacro MUI_INSTALLOPTIONS_READ $CONTEXT "SetContext.ini" "Field 2" "State"

  ; TODO: Check that, if CONTEXT is set on silent install (meaning /ALLUSERS
  ; was given on the command line), $ISADMIN is set as well, otherwise we
  ; can't install for all users.

  ; Get rid of leftover start menus
  StrCmp $CONTEXT "1" 0 +3
  RMDir /r "$SMPROGRAMS\gtkmm for Mingw"
  SetShellVarContext all

  ; Start Menu
  CreateDirectory "$SMPROGRAMS\$ICONS_GROUP"

  SetOutPath $INSTDIR\redist
  File /oname=README.txt "redist_README.txt"

  SetOutPath $INSTDIR
  File "gtkmm.ico"
  File "lgpl.txt"
  File "gtkmm_win32.txt"
  CreateShortCut "$SMPROGRAMS\$ICONS_GROUP\License.lnk" "$INSTDIR\lgpl.txt"
  CreateShortCut "$SMPROGRAMS\$ICONS_GROUP\Read Me.lnk" "$INSTDIR\gtkmm_win32.txt"
  
  WriteIniStr "$INSTDIR\${PRODUCT_NAME}.url" "InternetShortcut" "URL" "${PRODUCT_WEB_SITE}"
  CreateShortCut "$SMPROGRAMS\$ICONS_GROUP\Website.lnk" "$INSTDIR\${PRODUCT_NAME}.url"

  ; Registry + Add/Remove Entry
  StrCmp $CONTEXT "1" 0 +11
  WriteRegStr HKLM "Software\${PRODUCT_PLATFORM_NAME}\${PRODUCT_API_VERSION}" "Path" "$INSTDIR"
  WriteRegStr HKLM "Software\${PRODUCT_PLATFORM_NAME}\${PRODUCT_API_VERSION}" "Version" "${PRODUCT_VERSION}"
  WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_PLATFORM_NAME}" "DisplayName" "${PRODUCT_FULLNAME} ${PRODUCT_VERSION_MAJOR}.${PRODUCT_VERSION_MINOR}" ; TODO: separate display name for 32 and 64 bit
  WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_PLATFORM_NAME}" "DisplayIcon" "$INSTDIR\gtkmm.ico"
  WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_PLATFORM_NAME}" "Publisher" "${PRODUCT_PUBLISHER}"
  WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_PLATFORM_NAME}" "UninstallString" "$INSTDIR\${GTKMM_UNINSTALL_EXE}"
  WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_PLATFORM_NAME}" "DisplayVersion" "${PRODUCT_VERSION}-${PRODUCT_VERSION_INSTALLER}"
  WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_PLATFORM_NAME}" "URLInfoAbout" "${PRODUCT_WEB_SITE}"
  WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_PLATFORM_NAME}" "NSIS:StartMenuDir" "$ICONS_GROUP"
  Goto +10
  WriteRegStr HKCU "Software\${PRODUCT_PLATFORM_NAME}\${PRODUCT_API_VERSION}" "Path" "$INSTDIR"
  WriteRegStr HKCU "Software\${PRODUCT_PLATFORM_NAME}\${PRODUCT_API_VERSION}" "Version" "${PRODUCT_VERSION}"
  WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_PLATFORM_NAME}" "DisplayName" "${PRODUCT_FULLNAME} ${PRODUCT_VERSION_MAJOR}.${PRODUCT_VERSION_MINOR}"
  WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_PLATFORM_NAME}" "DisplayIcon" "$INSTDIR\gtkmm.ico"
  WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_PLATFORM_NAME}" "Publisher" "${PRODUCT_PUBLISHER}"
  WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_PLATFORM_NAME}" "UninstallString" "$INSTDIR\${GTKMM_UNINSTALL_EXE}"
  WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_PLATFORM_NAME}" "DisplayVersion" "${PRODUCT_VERSION}-${PRODUCT_VERSION_INSTALLER}"
  WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_PLATFORM_NAME}" "URLInfoAbout" "${PRODUCT_WEB_SITE}"
  WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_PLATFORM_NAME}" "NSIS:StartMenuDir" "$ICONS_GROUP"

!ifndef RUNTIME_ONLY
  IfFileExists "$INSTDIR\share\doc\*.*" "" +2
    CreateDirectory "$SMPROGRAMS\$ICONS_GROUP\Documentation"
  IfFileExists "$INSTDIR\share\gtk-doc\html\*.*" "" +2
    CreateDirectory "$SMPROGRAMS\$ICONS_GROUP\Documentation"

  IfFileExists "$INSTDIR\share\gtk-doc\html\libxml2\index.html" "" +2
       CreateShortCut "$SMPROGRAMS\$ICONS_GROUP\Documentation\libxml2 Reference Manual.lnk" "$INSTDIR\share\gtk-doc\html\libxml2\index.html"

  IfFileExists "$INSTDIR\share\gtk-doc\html\glib\index.html" "" +2
       CreateShortCut "$SMPROGRAMS\$ICONS_GROUP\Documentation\glib Reference Manual.lnk" "$INSTDIR\share\gtk-doc\html\glib\index.html"

  IfFileExists "$INSTDIR\share\gtk-doc\html\gobject\index.html" "" +2
       CreateShortCut "$SMPROGRAMS\$ICONS_GROUP\Documentation\gobject Reference Manual.lnk" "$INSTDIR\share\gtk-doc\html\gobject\index.html"

  IfFileExists "$INSTDIR\share\gtk-doc\html\cairo\index.html" "" +2
       CreateShortCut "$SMPROGRAMS\$ICONS_GROUP\Documentation\cairo Reference Manual.lnk" "$INSTDIR\share\gtk-doc\html\cairo\index.html"

  IfFileExists "$INSTDIR\share\gtk-doc\html\pango\index.html" "" +2
       CreateShortCut "$SMPROGRAMS\$ICONS_GROUP\Documentation\pango Reference Manual.lnk" "$INSTDIR\share\gtk-doc\html\pango\index.html"

  IfFileExists "$INSTDIR\share\gtk-doc\html\gdk\index.html" "" +2
       CreateShortCut "$SMPROGRAMS\$ICONS_GROUP\Documentation\GDK Reference Manual.lnk" "$INSTDIR\share\gtk-doc\html\gdk\index.html"

  IfFileExists "$INSTDIR\share\gtk-doc\html\gdk-pixbuf\index.html" "" +2
       CreateShortCut "$SMPROGRAMS\$ICONS_GROUP\Documentation\gdk-pixbuf Reference Manual.lnk" "$INSTDIR\share\gtk-doc\html\gdk-pixbuf\index.html"

  IfFileExists "$INSTDIR\share\gtk-doc\html\gtk\index.html" "" +2
       CreateShortCut "$SMPROGRAMS\$ICONS_GROUP\Documentation\GTK+ Reference Manual.lnk" "$INSTDIR\share\gtk-doc\html\gtk\index.html"

  IfFileExists "$INSTDIR\share\gtk-doc\html\libglade\index.html" "" +2
       CreateShortCut "$SMPROGRAMS\$ICONS_GROUP\Documentation\libglade Reference Manual.lnk" "$INSTDIR\share\gtk-doc\html\libglade\index.html"

  IfFileExists "$INSTDIR\share\gtk-doc\html\gail-libgail-util\index.html" "" +2
       CreateShortCut "$SMPROGRAMS\$ICONS_GROUP\Documentation\libgail-util Reference Manual.lnk" "$INSTDIR\share\gtk-doc\html\gail-libgail-util\index.html"

  IfFileExists "$INSTDIR\share\doc\libsigc++-2.0\index.html" "" +2
       CreateShortCut "$SMPROGRAMS\$ICONS_GROUP\Documentation\libsigc++ Reference Manual.lnk" "$INSTDIR\share\doc\libsigc++-2.0\index.html"

  IfFileExists "$INSTDIR\share\doc\cairomm-1.0\reference\html\index.html" "" +2
       CreateShortCut "$SMPROGRAMS\$ICONS_GROUP\Documentation\cairomm Reference Manual.lnk" "$INSTDIR\share\doc\cairomm-1.0\reference\html\index.html"

  IfFileExists "$INSTDIR\share\doc\glibmm-2.4\reference\html\index.html" "" +2
       CreateShortCut "$SMPROGRAMS\$ICONS_GROUP\Documentation\glibmm Reference Manual.lnk" "$INSTDIR\share\doc\glibmm-2.4\reference\html\index.html"

  IfFileExists "$INSTDIR\share\doc\pangomm-1.4\reference\html\index.html" "" +2
       CreateShortCut "$SMPROGRAMS\$ICONS_GROUP\Documentation\pangomm Reference Manual.lnk" "$INSTDIR\share\doc\pangomm-1.4\reference\html\index.html"

  IfFileExists "$INSTDIR\share\doc\atkmm-1.6\reference\html\index.html" "" +2
       CreateShortCut "$SMPROGRAMS\$ICONS_GROUP\Documentation\atkmm Reference Manual.lnk" "$INSTDIR\share\doc\atkmm-1.6\reference\html\index.html"

  IfFileExists "$INSTDIR\share\doc\gtkmm-2.4\reference\html\index.html" "" +2
       CreateShortCut "$SMPROGRAMS\$ICONS_GROUP\Documentation\gtkmm Reference Manual.lnk" "$INSTDIR\share\doc\gtkmm-2.4\reference\html\index.html"

  IfFileExists "$INSTDIR\share\doc\gtkmm-2.4\tutorial\html\index.html" "" +2
       CreateShortCut "$SMPROGRAMS\$ICONS_GROUP\Documentation\Programming with gtkmm.lnk" "$INSTDIR\share\doc\gtkmm-2.4\tutorial\html\index.html"

  IfFileExists "$INSTDIR\share\doc\gnomemm-2.6\libglademm-2.4\docs\reference\html\index.html" "" +2
       CreateShortCut "$SMPROGRAMS\$ICONS_GROUP\Documentation\libglademm Reference Manual.lnk" "$INSTDIR\share\doc\gnomemm-2.6\libglademm-2.4\docs\reference\html\index.html"     

  IfFileExists "$INSTDIR\share\doc\libxml++-2.6\reference\html\index.html" "" +2
       CreateShortCut "$SMPROGRAMS\$ICONS_GROUP\Documentation\libxml++ Reference Manual.lnk" "$INSTDIR\share\doc\libxml++-2.6\reference\html\index.html"

  IfFileExists "$INSTDIR\gtkmm-demo\gtkmm-demo.exe" "" +11
       Push $OUTDIR
       SetOutPath "$INSTDIR\gtkmm-demo"
       CreateShortCut "$SMPROGRAMS\$ICONS_GROUP\Demo.lnk" "$INSTDIR\gtkmm-demo\gtkmm-demo.exe" "" "$INSTDIR\gtkmm.ico"
       StrCmp $CONTEXT "1" 0 +4
       WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\App Paths\gtkmm-demo.exe" "" "$INSTDIR\gtkmm-demo\gtkmm-demo.exe"
       WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\App Paths\gtkmm-demo.exe" "Path" "$INSTDIR\bin"
       Goto +3
       WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\App Paths\gtkmm-demo.exe" "" "$INSTDIR\gtkmm-demo\gtkmm-demo.exe"
       WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\App Paths\gtkmm-demo.exe" "Path" "$INSTDIR\bin"
       Pop $OUTDIR
       
!endif  ; RUNTIME_ONLY

  ; GTKMM_BASEPATH environment variable
  Push "GTKMM_BASEPATH" ;
  Push "$INSTDIR"
  Push $CONTEXT
  Call WriteEnvStr

  ; Uninstaller
  WriteUninstaller "$INSTDIR\${GTKMM_UNINSTALL_EXE}"
  CreateShortCut "$SMPROGRAMS\$ICONS_GROUP\Uninstall.lnk" "$INSTDIR\${GTKMM_UNINSTALL_EXE}"

!ifdef RUNTIME_ONLY
  ; Set the PATH with gtkmm target directory (if relevant)
  IfSilent +2
  ; Read a value from an InstallOptions INI file
  !insertmacro MUI_INSTALLOPTIONS_READ $CB_PATH_VALUE "PathQuestion.ini" "Field 1" "State"
!endif ; RUNTIME_ONLY
  StrCmp $CB_PATH_VALUE "1" "" done
     Push $CONTEXT
     Push "$INSTDIR\bin"
     Call AddToPath
done:

SectionEnd

Section Uninstall SecUninstall

  ClearErrors
  UserInfo::GetName
  IfErrors done
  Pop $0
  UserInfo::GetAccountType
  Pop $0
  StrCmp $0 "Admin" 0 done
  StrCpy $ISADMIN "1"
done:
 
  ClearErrors
  ReadRegStr $R0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_PLATFORM_NAME}" "DisplayName"
  IfErrors continue
  StrCpy $CONTEXT "1"
  SetShellVarContext all
  StrCmp $ISADMIN "1" continue
  MessageBox MB_OK|MB_ICONEXCLAMATION "$(MISC_ADMIN_REQUIRED)"
  Quit
  
continue:
  StrCmp $CONTEXT "1" 0 +4
  ReadRegStr $INSTDIR HKLM "Software\${PRODUCT_PLATFORM_NAME}\${PRODUCT_API_VERSION}" "Path"
  ReadRegStr $ICONS_GROUP HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_PLATFORM_NAME}" "NSIS:StartMenuDir"
  Goto +3
  ReadRegStr $INSTDIR HKCU "Software\${PRODUCT_PLATFORM_NAME}\${PRODUCT_API_VERSION}" "Path"
  ReadRegStr $ICONS_GROUP HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_PLATFORM_NAME}" "NSIS:StartMenuDir"
  
  ;Remove shortcut
  Delete "$SMPROGRAMS\$ICONS_GROUP\Uninstall.lnk"
  Delete "$SMPROGRAMS\$ICONS_GROUP\Website.lnk"
  Delete "$SMPROGRAMS\$ICONS_GROUP\License.lnk"
  Delete "$SMPROGRAMS\$ICONS_GROUP\Read Me.lnk"

!ifndef RUNTIME_ONLY
  Delete "$SMPROGRAMS\$ICONS_GROUP\Documentation\libxml2 Reference Manual.lnk"
  Delete "$SMPROGRAMS\$ICONS_GROUP\Documentation\glib Reference Manual.lnk"
  Delete "$SMPROGRAMS\$ICONS_GROUP\Documentation\gobject Reference Manual.lnk"
  Delete "$SMPROGRAMS\$ICONS_GROUP\Documentation\cairo Reference Manual.lnk"
  Delete "$SMPROGRAMS\$ICONS_GROUP\Documentation\pango Reference Manual.lnk"
  Delete "$SMPROGRAMS\$ICONS_GROUP\Documentation\GDK Reference Manual.lnk"
  Delete "$SMPROGRAMS\$ICONS_GROUP\Documentation\gdk-pixbuf Reference Manual.lnk"
  Delete "$SMPROGRAMS\$ICONS_GROUP\Documentation\GTK+ Reference Manual.lnk"
  Delete "$SMPROGRAMS\$ICONS_GROUP\Documentation\libglade Reference Manual.lnk"
  Delete "$SMPROGRAMS\$ICONS_GROUP\Documentation\libgail-util Reference Manual.lnk"

  Delete "$SMPROGRAMS\$ICONS_GROUP\Documentation\libsigc++ Reference Manual.lnk"
  Delete "$SMPROGRAMS\$ICONS_GROUP\Documentation\glibmm Reference Manual.lnk"
  Delete "$SMPROGRAMS\$ICONS_GROUP\Documentation\pangomm Reference Manual.lnk"
  Delete "$SMPROGRAMS\$ICONS_GROUP\Documentation\atkmm Reference Manual.lnk"
  Delete "$SMPROGRAMS\$ICONS_GROUP\Documentation\gtkmm Reference Manual.lnk"
  Delete "$SMPROGRAMS\$ICONS_GROUP\Documentation\Programming with gtkmm.lnk"
  Delete "$SMPROGRAMS\$ICONS_GROUP\Documentation\libglademm Reference Manual.lnk"
  Delete "$SMPROGRAMS\$ICONS_GROUP\Documentation\cairomm Reference Manual.lnk"
  Delete "$SMPROGRAMS\$ICONS_GROUP\Documentation\libxml++ Reference Manual.lnk"
  RMDir "$SMPROGRAMS\$ICONS_GROUP\Documentation"
  
  Delete "$SMPROGRAMS\$ICONS_GROUP\Demo.lnk"
;  Delete "$SMPROGRAMS\$ICONS_GROUP\Gideon.lnk"
!endif

  RMDir "$SMPROGRAMS\$ICONS_GROUP"

  SetAutoClose true
  
  ; Delete language selection
  DeleteRegValue HKCU "Software\${PRODUCT_PLATFORM_NAME}\${PRODUCT_API_VERSION}" "Installer Language"
  DeleteRegKey /ifempty  HKCU "Software\${PRODUCT_PLATFORM_NAME}\${PRODUCT_API_VERSION}"
  DeleteRegKey /ifempty  HKCU "Software\${PRODUCT_PLATFORM_NAME}"
  
  StrCmp $CONTEXT "1" 0 +8
  DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_PLATFORM_NAME}"
  DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\App Paths\gtkmm-demo.exe"
  DeleteRegKey HKLM "Software\${PRODUCT_PLATFORM_NAME}\${PRODUCT_API_VERSION}"
  DeleteRegKey /ifempty  HKLM "Software\${PRODUCT_PLATFORM_NAME}"
  ReadRegStr $R0 HKLM "Software\GTK\2.0" "PATH"; ???
  Goto +7
  DeleteRegKey HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_PLATFORM_NAME}"
  DeleteRegKey HKCU "Software\Microsoft\Windows\CurrentVersion\App Paths\gtkmm-demo.exe"
  DeleteRegKey HKCU "Software\Microsoft\Windows\CurrentVersion\App Paths\gideon.exe"
  DeleteRegKey HKCU "Software\${PRODUCT_PLATFORM_NAME}\${PRODUCT_API_VERSION}"
  DeleteRegKey /ifempty  HKCU "Software\${PRODUCT_PLATFORM_NAME}"
  ReadRegStr $R0 HKCU "Software\GTK\2.0" "PATH"; ???
  
  ; Remove gtkmm from PATH
  StrCmp $R0 $INSTDIR +4
     Push $CONTEXT
     Push "$INSTDIR\bin"
     Call un.RemoveFromPath

  Delete "$INSTDIR\gtkmm.ico"
  Delete "$INSTDIR\gtkmm_win32.txt"
  Delete "$INSTDIR\lgpl.txt"
  Delete "$INSTDIR\${PRODUCT_NAME}.url"

!ifndef RUNTIME_ONLY
  ; redist
  Delete $INSTDIR\redist\libgcc_s_sjlj-1.dll
  Delete $INSTDIR\redist\zlib1.dll
  Delete $INSTDIR\redist\intl.dll
;  Delete $INSTDIR\redist\iconv.dll
;  Delete $INSTDIR\redist\charset.dll

  Delete $INSTDIR\redist\libxml2-2.dll
;  Delete $INSTDIR\redist\libjpeg-7.dll
  Delete $INSTDIR\redist\libpng14-14.dll
;  Delete $INSTDIR\redist\libtiff-3.dll
  Delete $INSTDIR\redist\freetype6.dll
  Delete $INSTDIR\redist\libexpat-1.dll
  Delete $INSTDIR\redist\libfontconfig-1.dll
  Delete $INSTDIR\redist\libglib-2.0-0.dll
  Delete $INSTDIR\redist\libgobject-2.0-0.dll
  Delete $INSTDIR\redist\libgmodule-2.0-0.dll
  Delete $INSTDIR\redist\libgthread-2.0-0.dll
  Delete $INSTDIR\redist\libgio-2.0-0.dll
  Delete $INSTDIR\redist\libcairo-2.dll
  Delete $INSTDIR\redist\libatk-1.0-0.dll
  Delete $INSTDIR\redist\libpango-1.0-0.dll
  Delete $INSTDIR\redist\libpangocairo-1.0-0.dll
  Delete $INSTDIR\redist\libpangoft2-1.0-0.dll
  Delete $INSTDIR\redist\libpangowin32-1.0-0.dll
  Delete $INSTDIR\redist\libgailutil-18.dll
  Delete $INSTDIR\redist\libgdk-win32-2.0-0.dll
  Delete $INSTDIR\redist\libgdk_pixbuf-2.0-0.dll
  Delete $INSTDIR\redist\libgtk-win32-2.0-0.dll
  Delete $INSTDIR\redist\libglade-2.0-0.dll
  Delete $INSTDIR\redist\gspawn-win32-helper.exe
  Delete $INSTDIR\redist\gspawn-win32-helper-console.exe

  Delete $INSTDIR\redist\libsigc-2.0-0.dll
  Delete $INSTDIR\redist\libcairomm-1.0-1.dll
  Delete $INSTDIR\redist\libglibmm-2.4-1.dll
  Delete $INSTDIR\redist\libgiomm-2.4-1.dll
  Delete $INSTDIR\redist\libpangomm-1.4-1.dll
  Delete $INSTDIR\redist\libatkmm-1.6-1.dll
  Delete $INSTDIR\redist\libgdkmm-2.4-1.dll
  Delete $INSTDIR\redist\libgtkmm-2.4-1.dll
  Delete $INSTDIR\redist\libglademm-2.4-1.dll
  Delete $INSTDIR\redist\libxml++-2.6-2.dll
  Delete $INSTDIR\redist\README.txt
  RMDir $INSTDIR\redist

  ; bin

;  Delete $INSTDIR\bin\iconv.exe
  Delete $INSTDIR\bin\pkg-config.exe
  Delete $INSTDIR\bin\glib-genmarshal.exe
  Delete $INSTDIR\bin\glib-gettextize
  Delete $INSTDIR\bin\glib-mkenums
  Delete $INSTDIR\bin\gobject-query.exe
  Delete $INSTDIR\bin\pango-querymodules.exe
  Delete $INSTDIR\bin\gdk-pixbuf-csource.exe
  Delete $INSTDIR\bin\gdk-pixbuf-query-loaders.exe
  Delete $INSTDIR\bin\gtk-builder-convert
  Delete $INSTDIR\bin\gtk-query-immodules-2.0.exe

  ; include
  RMDir /r $INSTDIR\include\libxml2
  RMDir /r $INSTDIR\include\freetype2
  RMDir /r $INSTDIR\include\fontconfig
  RMDir /r $INSTDIR\include\libpng14
  RMDIR /r $INSTDIR\include\glib-2.0
  RMDIR /r $INSTDIR\include\cairo
  RMDIR /r $INSTDIR\include\pango-1.0
  RMDIR /r $INSTDIR\include\atk-1.0
  RMDir /r $INSTDIR\include\gdk-pixbuf-2.0
  RMDIR /r $INSTDIR\include\gtk-2.0
  RMDIR /r $INSTDIR\include\libglade-2.0
  RMDir /r $INSTDIR\include\gail-1.0
  Delete $INSTDIR\include\expat.h
  Delete $INSTDIR\include\expat_external.h
  Delete $INSTDIR\include\ft2build.h
;  Delete $INSTDIR\include\iconv.h
;  Delete $INSTDIR\include\jconfig.h
;  Delete $INSTDIR\include\jerror.h
;  Delete $INSTDIR\include\jmorecfg.h
;  Delete $INSTDIR\include\jpeglib.h
;  Delete $INSTDIR\include\libcharset.h
;  Delete $INSTDIR\include\localcharset.h
  Delete $INSTDIR\include\libintl.h
  Delete $INSTDIR\include\png.h
  Delete $INSTDIR\include\pngconf.h
;  Delete $INSTDIR\include\tiff.h
;  Delete $INSTDIR\include\tiffconf.h
;  Delete $INSTDIR\include\tiffio.h
;  Delete $INSTDIR\include\tiffvers.h
  Delete $INSTDIR\include\zconf.h
  Delete $INSTDIR\include\zlib.h

  RMDir /r $INSTDIR\include\sigc++-2.0
  RMDir /r $INSTDIR\include\cairomm-1.0
  RMDir /r $INSTDIR\include\glibmm-2.4
  RMDir /r $INSTDIR\include\giomm-2.4
  RMDir /r $INSTDIR\include\pangomm-1.4
  RMDir /r $INSTDIR\include\atkmm-1.6
  RMDir /r $INSTDIR\include\gdkmm-2.4
  RMDir /r $INSTDIR\include\gtkmm-2.4
  RMDir /r $INSTDIR\include\libglademm-2.4
  RMDir /r $INSTDIR\include\libxml++-2.6

  ; lib

  RMDir /r $INSTDIR\lib\glib-2.0\include
  RMDir /r $INSTDIR\lib\gtk-2.0\include
  RMDir $INSTDIR\lib\glib-2.0

  RMDir /r $INSTDIR\lib\sigc++-2.0
  RMDir /r $INSTDIR\lib\cairomm-1.0
  RMDir /r $INSTDIR\lib\glibmm-2.4
  RMDir /r $INSTDIR\lib\giomm-2.4
  RMDir /r $INSTDIR\lib\atkmm-1.6
  RMDir /r $INSTDIR\lib\pangomm-1.4
  RMDir /r $INSTDIR\lib\gdkmm-2.4
  RMDir /r $INSTDIR\lib\gtkmm-2.4
  RMDir /r $INSTDIR\lib\libglademm-2.4
  RMDir /r $INSTDIR\lib\libxml++-2.6

  Delete $INSTDIR\lib\libxml2.lib
  Delete $INSTDIR\lib\libxml2.dll.a
;  Delete $INSTDIR\lib\charset.lib
;  Delete $INSTDIR\lib\iconv.lib
;  Delete $INSTDIR\lib\libiconv.a
  Delete $INSTDIR\lib\libintl.dll.a
;  Delete $INSTDIR\lib\libtiff.dll.a
  Delete $INSTDIR\lib\libpng14.dll.a
  Delete $INSTDIR\lib\libz.dll.a
  Delete $INSTDIR\lib\libfreetype.dll.a
  Delete $INSTDIR\lib\libexpat.dll.a
  Delete $INSTDIR\lib\libfontconfig.dll.a
  Delete $INSTDIR\lib\libglib-2.0.dll.a
  Delete $INSTDIR\lib\libgobject-2.0.dll.a
  Delete $INSTDIR\lib\libgmodule-2.0.dll.a
  Delete $INSTDIR\lib\libgthread-2.0.dll.a
  Delete $INSTDIR\lib\libgio-2.0.dll.a
  Delete $INSTDIR\lib\libcairo.dll.a
  Delete $INSTDIR\lib\libpango-1.0.dll.a
  Delete $INSTDIR\lib\libpangocairo-1.0.dll.a
  Delete $INSTDIR\lib\libpangoft2-1.0.dll.a
  Delete $INSTDIR\lib\libpangowin32-1.0.dll.a
  Delete $INSTDIR\lib\libatk-1.0.dll.a
  Delete $INSTDIR\lib\libgailutil.dll.a
  Delete $INSTDIR\lib\libgdk-win32-2.0.dll.a
  Delete $INSTDIR\lib\libgdk_pixbuf-2.0.dll.a
  Delete $INSTDIR\lib\libgtk-win32-2.0.dll.a
  Delete $INSTDIR\lib\libglade-2.0.dll.a

  Delete $INSTDIR\lib\libsigc-*.dll.a
  Delete $INSTDIR\lib\libcairomm-*.dll.a
  Delete $INSTDIR\lib\libglibmm-*.dll.a
  Delete $INSTDIR\lib\libglibmm_generate_extra_defs-*.dll.a
  Delete $INSTDIR\lib\libgiomm-*.dll.a
  Delete $INSTDIR\lib\libpangomm-*.dll.a
  Delete $INSTDIR\lib\libatkmm-*.dll.a
  Delete $INSTDIR\lib\libgdkmm-*.dll.a
  Delete $INSTDIR\lib\libgtkmm-*.dll.a
  Delete $INSTDIR\lib\libglademm-*.dll.a
  Delete $INSTDIR\lib\libxml++-*.dll.a
 
  Delete $INSTDIR\lib\libintl.def
  Delete $INSTDIR\lib\intl.lib
;  Delete $INSTDIR\lib\libtiff.def
;  Delete $INSTDIR\lib\libtiff.lib
  Delete $INSTDIR\lib\libpng.def
  Delete $INSTDIR\lib\libpng.lib
  Delete $INSTDIR\lib\zlib.def
  Delete $INSTDIR\lib\zdll.lib
  Delete $INSTDIR\lib\libexpat.def
  Delete $INSTDIR\lib\expat.lib
  Delete $INSTDIR\lib\fontconfig.def
  Delete $INSTDIR\lib\fontconfig.lib
  Delete $INSTDIR\lib\glib-2.0.def
  Delete $INSTDIR\lib\glib-2.0.lib
  Delete $INSTDIR\lib\gobject-2.0.def
  Delete $INSTDIR\lib\gobject-2.0.lib
  Delete $INSTDIR\lib\gmodule-2.0.def
  Delete $INSTDIR\lib\gmodule-2.0.lib
  Delete $INSTDIR\lib\gthread-2.0.def
  Delete $INSTDIR\lib\gthread-2.0.lib
  Delete $INSTDIR\lib\gio-2.0.def
  Delete $INSTDIR\lib\gio-2.0.lib
  Delete $INSTDIR\lib\cairo.def
  Delete $INSTDIR\lib\cairo.lib
  Delete $INSTDIR\lib\pango-1.0.def
  Delete $INSTDIR\lib\pango-1.0.lib
  Delete $INSTDIR\lib\pangocairo-1.0.def
  Delete $INSTDIR\lib\pangocairo-1.0.lib
  Delete $INSTDIR\lib\pangoft2-1.0.def
  Delete $INSTDIR\lib\pangoft2-1.0.lib
  Delete $INSTDIR\lib\pangowin32-1.0.def
  Delete $INSTDIR\lib\pangowin32-1.0.lib
  Delete $INSTDIR\lib\atk-1.0.def
  Delete $INSTDIR\lib\atk-1.0.lib
  Delete $INSTDIR\lib\gailutil.lib
  Delete $INSTDIR\lib\gdk-win32-2.0.lib
  Delete $INSTDIR\lib\gdk_pixbuf-2.0.lib
  Delete $INSTDIR\lib\gtk-win32-2.0.lib
  Delete $INSTDIR\lib\glade-2.0.lib

  Delete $INSTDIR\lib\sigc-*.lib
  Delete $INSTDIR\lib\cairomm-*.lib
  Delete $INSTDIR\lib\glibmm-*.lib
  Delete $INSTDIR\lib\giomm-*.lib
  Delete $INSTDIR\lib\pangomm-*.lib
  Delete $INSTDIR\lib\atkmm-*.lib
  Delete $INSTDIR\lib\gdkmm-*.lib
  Delete $INSTDIR\lib\gtkmm-*.lib
  Delete $INSTDIR\lib\glademm-*.lib
  Delete $INSTDIR\lib\xml++-*.lib

  Delete $INSTDIR\lib\pkgconfig\libxml-2.0.pc
  Delete $INSTDIR\lib\pkgconfig\libpng.pc
  Delete $INSTDIR\lib\pkgconfig\libpng14.pc
  Delete $INSTDIR\lib\pkgconfig\freetype2.pc
  Delete $INSTDIR\lib\pkgconfig\fontconfig.pc
  Delete $INSTDIR\lib\pkgconfig\glib-2.0.pc
  Delete $INSTDIR\lib\pkgconfig\gmodule-2.0.pc
  Delete $INSTDIR\lib\pkgconfig\gmodule-no-export-2.0.pc
  Delete $INSTDIR\lib\pkgconfig\gobject-2.0.pc
  Delete $INSTDIR\lib\pkgconfig\gthread-2.0.pc
  Delete $INSTDIR\lib\pkgconfig\gio-2.0.pc
  Delete $INSTDIR\lib\pkgconfig\cairo.pc
  Delete $INSTDIR\lib\pkgconfig\cairo-png.pc
  Delete $INSTDIR\lib\pkgconfig\cairo-pdf.pc
  Delete $INSTDIR\lib\pkgconfig\cairo-ps.pc
  Delete $INSTDIR\lib\pkgconfig\cairo-svg.pc
  Delete $INSTDIR\lib\pkgconfig\cairo-win32.pc
  Delete $INSTDIR\lib\pkgconfig\cairo-win32-font.pc
  Delete $INSTDIR\lib\pkgconfig\pango.pc
  Delete $INSTDIR\lib\pkgconfig\pangocairo.pc
  Delete $INSTDIR\lib\pkgconfig\pangoft2.pc
  Delete $INSTDIR\lib\pkgconfig\pangowin32.pc
  Delete $INSTDIR\lib\pkgconfig\atk.pc
  Delete $INSTDIR\lib\pkgconfig\gdk-2.0.pc
  Delete $INSTDIR\lib\pkgconfig\gdk-pixbuf-2.0.pc
  Delete $INSTDIR\lib\pkgconfig\gdk-win32-2.0.pc
  Delete $INSTDIR\lib\pkgconfig\gtk+-2.0.pc
  Delete $INSTDIR\lib\pkgconfig\gtk+-win32-2.0.pc  
  Delete $INSTDIR\lib\pkgconfig\libglade-2.0.pc  
  Delete $INSTDIR\lib\pkgconfig\gail.pc

  Delete $INSTDIR\lib\pkgconfig\sigc++-*.pc
  Delete $INSTDIR\lib\pkgconfig\cairomm-*.pc
  Delete $INSTDIR\lib\pkgconfig\glibmm-*.pc
  Delete $INSTDIR\lib\pkgconfig\giomm-*.pc
  Delete $INSTDIR\lib\pkgconfig\pangomm-*.pc
  Delete $INSTDIR\lib\pkgconfig\atkmm-*.pc
  Delete $INSTDIR\lib\pkgconfig\gdkmm-*.pc
  Delete $INSTDIR\lib\pkgconfig\gtkmm-*.pc
  Delete $INSTDIR\lib\pkgconfig\libglademm-*.pc
  Delete $INSTDIR\lib\pkgconfig\libxml++-*.pc
  RMDir $INSTDIR\lib\pkgconfig

  ; share

;  RMDir /r $INSTDIR\share\doc\libiconv

  RMDir /r $INSTDIR\share\doc\glib-dev-2.26.0
  RMDir /r $INSTDIR\share\doc\pango-dev-1.28.3
  RMDir /r $INSTDIR\share\doc\gtk+-dev-2.22.0

  RMDir /r $INSTDIR\share\xml\libglade
  RMDir $INSTDIR\share\xml

  RMDir /r $INSTDIR\share\glib-2.0

  Delete $INSTDIR\share\aclocal\libxml.m4
  Delete $INSTDIR\share\aclocal\freetype2.m4
  Delete $INSTDIR\share\aclocal\glib-2.0.m4
  Delete $INSTDIR\share\aclocal\glib-gettext.m4
  Delete $INSTDIR\share\aclocal\gtk-2.0.m4
  Delete $INSTDIR\share\aclocal\pkg.m4

  RMDir /r $INSTDIR\share\gtk-doc\html\libxml2
  RMDir /r $INSTDIR\share\gtk-doc\html\glib
  RMDir /r $INSTDIR\share\gtk-doc\html\gobject
  RMDir /r $INSTDIR\share\gtk-doc\html\cairo
  RMDir /r $INSTDIR\share\gtk-doc\html\pango
  RMDir /r $INSTDIR\share\gtk-doc\html\gdk
  RMDir /r $INSTDIR\share\gtk-doc\html\gdk-pixbuf
  RMDir /r $INSTDIR\share\gtk-doc\html\gtk
  RMDir /r $INSTDIR\share\gtk-doc\html\libglade
  RMDir /r $INSTDIR\share\gtk-doc\html\gail-libgail-util
  RMDir $INSTDIR\share\gtk-doc\html
  RMDir $INSTDIR\share\gtk-doc

  RMDir /r $INSTDIR\share\doc\libsigc++-2.0
  RMDir /r $INSTDIR\share\doc\cairomm-1.0
  RMDir /r $INSTDIR\share\doc\glibmm-2.4
  RMDir /r $INSTDIR\share\doc\pangomm-1.4
  RMDir /r $INSTDIR\share\doc\atkmm-1.6
  RMDir /r $INSTDIR\share\doc\gtkmm-2.4
  RMDir /r $INSTDIR\share\doc\gnomemm-2.6\libglademm-2.4
  RMDir $INSTDIR\share\doc\gnomemm-2.6
  RMDir /r $INSTDIR\share\doc\libxml++-2.6
  RMDir $INSTDIR\share\doc
  
  RMDir /r $INSTDIR\share\devhelp\books\glibmm-2.4
  RMDir /r $INSTDIR\share\devhelp\books\atkmm-1.6
  RMDir /r $INSTDIR\share\devhelp\books\pangomm-1.4
  RMDir /r $INSTDIR\share\devhelp\books\gtkmm-2.4
  RMDir /r $INSTDIR\share\devhelp\books\libglademm-2.4
  RMDir $INSTDIR\share\devhelp\books
  RMDir $INSTDIR\share\devhelp

  Delete $INSTDIR\share\aclocal\glibmm_check_perl.m4
  RMDir $INSTDIR\share\aclocal
  
  Delete $INSTDIR\MSVC\gtkmm-vc80-2_4.vsprops
  Delete $INSTDIR\MSVC\gtkmm-vc90-2_4.vsprops
  Delete $INSTDIR\MSVC\gtkmm-vc100-2_4.props
  Delete $INSTDIR\MSVC\gtkmm-vc80-d-2_4.vsprops
  Delete $INSTDIR\MSVC\gtkmm-vc90-d-2_4.vsprops
  Delete $INSTDIR\MSVC\gtkmm-vc100-d-2_4.props
  Delete $INSTDIR\MSVC\gtkmm-2.4.vsprops
  Delete $INSTDIR\MSVC\gtkmm-2.4d.vsprops
  RMDir $INSTDIR\MSVC
  
  ; gtkmm-demo
  Delete $INSTDIR\gtkmm-demo\gtkmm-demo.exe
  Delete $INSTDIR\gtkmm-demo\*.cc
  Delete $INSTDIR\gtkmm-demo\*.png
  Delete $INSTDIR\gtkmm-demo\*.jpg
  Delete $INSTDIR\gtkmm-demo\*.gif

  RMDir $INSTDIR\gtkmm-demo
  
  RMDir $INSTDIR\include

!endif

  ; bin

  Delete $INSTDIR\bin\libgcc_s_sjlj-1.dll
  Delete $INSTDIR\bin\zlib1.dll
  Delete $INSTDIR\bin\intl.dll
;  Delete $INSTDIR\bin\iconv.dll
;  Delete $INSTDIR\bin\charset.dll

  Delete $INSTDIR\bin\libxml2-2.dll
;  Delete $INSTDIR\bin\libjpeg-7.dll
  Delete $INSTDIR\bin\libpng14-14.dll
;  Delete $INSTDIR\bin\libtiff-3.dll
  Delete $INSTDIR\bin\freetype6.dll
  Delete $INSTDIR\bin\libexpat-1.dll
  Delete $INSTDIR\bin\libfontconfig-1.dll
  Delete $INSTDIR\bin\libglib-2.0-0.dll
  Delete $INSTDIR\bin\libgobject-2.0-0.dll
  Delete $INSTDIR\bin\libgmodule-2.0-0.dll
  Delete $INSTDIR\bin\libgthread-2.0-0.dll
  Delete $INSTDIR\bin\libgio-2.0-0.dll
  Delete $INSTDIR\bin\libcairo-2.dll
  Delete $INSTDIR\bin\libpango-1.0-0.dll
  Delete $INSTDIR\bin\libpangocairo-1.0-0.dll
  Delete $INSTDIR\bin\libpangoft2-1.0-0.dll
  Delete $INSTDIR\bin\libpangowin32-1.0-0.dll
  Delete $INSTDIR\bin\libatk-1.0-0.dll
  Delete $INSTDIR\bin\libgailutil-18.dll
  Delete $INSTDIR\bin\libgdk-win32-2.0-0.dll
  Delete $INSTDIR\bin\libgdk_pixbuf-2.0-0.dll
  Delete $INSTDIR\bin\libgtk-win32-2.0-0.dll
  Delete $INSTDIR\bin\libglade-2.0-0.dll
  Delete $INSTDIR\bin\gspawn-win32-helper.exe
  Delete $INSTDIR\bin\gspawn-win32-helper-console.exe
  Delete $INSTDIR\bin\gtk-update-icon-cache.exe
  Delete $INSTDIR\bin\gtk-demo.exe

  RMDir /r $INSTDIR\lib\gdk-pixbuf-2.0\2.10.0
  RMDir $INSTDIR\lib\gdk-pixbuf-2.0
  RMDir /r $INSTDIR\lib\gtk-2.0\2.10.0
  RMDir /r $INSTDIR\lib\gtk-2.0\modules
  RMDir $INSTDIR\lib\gtk-2.0
  RMDir $INSTDIR\lib
  
  ; etc
  RMDir /r $INSTDIR\etc\gtk-2.0
  RMDir /r $INSTDIR\etc\pango
  RMDir $INSTDIR\etc

  Delete $INSTDIR\bin\libsigc-*.dll
  Delete $INSTDIR\bin\libcairomm-*.dll
  Delete $INSTDIR\bin\libglibmm-*.dll
  Delete $INSTDIR\bin\libgiomm-*.dll
  Delete $INSTDIR\bin\libglibmm_generate_extra_defs-*.dll
  Delete $INSTDIR\bin\libatkmm-*.dll
  Delete $INSTDIR\bin\libpangomm-*.dll
  Delete $INSTDIR\bin\libgdkmm-*.dll
  Delete $INSTDIR\bin\libgtkmm-*.dll
  Delete $INSTDIR\bin\libglademm-*.dll
  Delete $INSTDIR\bin\libxml++-*.dll
 
  Delete $INSTDIR\bin\sigc++-*.dll
  Delete $INSTDIR\bin\sigc-*.dll
  Delete $INSTDIR\bin\cairomm-*.dll
  Delete $INSTDIR\bin\glibmm-*.dll
  Delete $INSTDIR\bin\giomm-*.dll
  Delete $INSTDIR\bin\atkmm-*.dll
  Delete $INSTDIR\bin\pangomm-*.dll
  Delete $INSTDIR\bin\gdkmm-*.dll
  Delete $INSTDIR\bin\gtkmm-*.dll
  Delete $INSTDIR\bin\glademm-*.dll
  Delete $INSTDIR\bin\xml++-*.dll
  
  Delete $INSTDIR\bin\sigc-*.pdb
  Delete $INSTDIR\bin\cairomm-*.pdb
  Delete $INSTDIR\bin\glibmm-*.pdb
  Delete $INSTDIR\bin\giomm-*.pdb
  Delete $INSTDIR\bin\atkmm-*.pdb
  Delete $INSTDIR\bin\gdkmm-*.pdb
  Delete $INSTDIR\bin\gtkmm-*.pdb
  Delete $INSTDIR\bin\pangomm-*.pdb
  Delete $INSTDIR\bin\glademm-*.pdb
  Delete $INSTDIR\bin\xml++-*.pdb
  
  RMDir $INSTDIR\bin
  
  ; share (non-development files)
  RMDir /r $INSTDIR\share\doc\glib-2.26.0
  RMDir /r $INSTDIR\share\doc\cairo_1.10.0-1_win32
  RMDir /r $INSTDIR\share\doc\pango-1.28.3
  RMDir /r $INSTDIR\share\doc\gtk+-2.22.0
  RMDir $INSTDIR\share\doc

  RMdir /r $INSTDIR\share\locale
  RMDir /r $INSTDIR\share\themes
  RMDir /r $INSTDIR\share\gtk-2.0

  RMDir $INSTDIR\share

  ; GTKMM_BASEPATH environment variable
  Push "GTKMM_BASEPATH";
  Push $CONTEXT
  Call un.DeleteEnvStr
  
  ; uninstaller
  Delete $INSTDIR\${GTKMM_UNINSTALL_EXE}
  
  ; $INSTDIR
  RMDir $INSTDIR

SectionEnd

;--------------------------------
; Section Description Macros

!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN

  !insertmacro MUI_DESCRIPTION_TEXT ${SecGTKRuntime} "GTK+ Runtime Environment"
  !insertmacro MUI_DESCRIPTION_TEXT ${SecSigcRuntime} "libsigc++ Runtime Libraries"
  !insertmacro MUI_DESCRIPTION_TEXT ${SecCairommRuntime} "cairomm Runtime Libraries"
  !insertmacro MUI_DESCRIPTION_TEXT ${SecGlibmmRuntime} "glibmm Runtime Libraries"
  !insertmacro MUI_DESCRIPTION_TEXT ${SecPangommRuntime} "pangomm Runtime Libraries"
  !insertmacro MUI_DESCRIPTION_TEXT ${SecAtkmmRuntime} "atkmm Runtime Libraries"
  !insertmacro MUI_DESCRIPTION_TEXT ${SecGtkmmRuntime} "gtkmm Runtime Libraries"
  !insertmacro MUI_DESCRIPTION_TEXT ${SecLibglademmRuntime} "libglademm Runtime Libraries"
  !insertmacro MUI_DESCRIPTION_TEXT ${SecLibxmlRuntime} "libxml++ Runtime Libraries"
 
!ifndef RUNTIME_ONLY
  !insertmacro MUI_DESCRIPTION_TEXT ${SecGTKDevelopment} "GTK+ development headers and import libraries"
  !insertmacro MUI_DESCRIPTION_TEXT ${SecGTKDocumentation} "GTK+ Documentation"
  !insertmacro MUI_DESCRIPTION_TEXT ${SecSigcDevelopment} "libsigc++ development headers and import libraries"
  !insertmacro MUI_DESCRIPTION_TEXT ${SecSigcDocumentation} "libsigc++ Documentation"

  !insertmacro MUI_DESCRIPTION_TEXT ${SecCairommDevelopment} "cairomm development headers and import libraries"
  !insertmacro MUI_DESCRIPTION_TEXT ${SecCairommDocumentation} "cairomm Documentation"

  !insertmacro MUI_DESCRIPTION_TEXT ${SecGlibmmDevelopment} "glibmm development headers and import libraries"
  !insertmacro MUI_DESCRIPTION_TEXT ${SecGlibmmDocumentation} "glibmm Documentation"

  !insertmacro MUI_DESCRIPTION_TEXT ${SecPangommDevelopment} "pangomm development headers and import libraries"
  !insertmacro MUI_DESCRIPTION_TEXT ${SecPangommDocumentation} "pangomm Documentation"
  !insertmacro MUI_DESCRIPTION_TEXT ${SecAtkmmDevelopment} "atkmm development headers and import libraries"
  !insertmacro MUI_DESCRIPTION_TEXT ${SecAtkmmDocumentation} "atkmm Documentation"

  !insertmacro MUI_DESCRIPTION_TEXT ${SecGtkmmDevelopment} "gtkmm development headers and import libraries"
  !insertmacro MUI_DESCRIPTION_TEXT ${SecGtkmmDocumentation} "gtkmm Documentation"

  !insertmacro MUI_DESCRIPTION_TEXT ${SecLibglademmDevelopment} "libglademm development headers and import libraries"
  !insertmacro MUI_DESCRIPTION_TEXT ${SecLibglademmDocumentation} "libglademm Documentation"

  !insertmacro MUI_DESCRIPTION_TEXT ${SecLibxmlDevelopment} "libxml++ development headers and import libraries"
  !insertmacro MUI_DESCRIPTION_TEXT ${SecLibxmlDocumentation} "libxml++ Documentation"
  
!endif
  
!insertmacro MUI_FUNCTION_DESCRIPTION_END

;--------------------------------
; General Functions

Function EnableGTKInstaller

;  !insertmacro SelectSection ${SecGTKInstaller}

  !insertmacro UnselectSection ${SecGTKRuntime}
  !insertmacro UnselectSection ${SecSigcRuntime}
  !insertmacro UnselectSection ${SecCairommRuntime}
  !insertmacro UnselectSection ${SecGlibmmRuntime}
  !insertmacro UnselectSection ${SecAtkmmRuntime}
  !insertmacro UnselectSection ${SecPangommRuntime}
  !insertmacro UnselectSection ${SecGtkmmRuntime}
  !insertmacro UnselectSection ${SecLibglademmRuntime}
  !insertmacro UnselectSection ${SecLibxmlRuntime}
  
!ifndef RUNTIME_ONLY
  !insertmacro UnselectSection ${SecGTKDevelopment}
  !insertmacro UnselectSection ${SecGTKDocumentation}

  !insertmacro UnselectSection ${SecSigcDevelopment}
  !insertmacro UnselectSection ${SecSigcDocumentation}

  !insertmacro UnselectSection ${SecCairommDevelopment}
  !insertmacro UnselectSection ${SecCairommDocumentation}

  !insertmacro UnselectSection ${SecGlibmmDevelopment}
  !insertmacro UnselectSection ${SecGlibmmDocumentation}

  !insertmacro UnselectSection ${SecPangommDevelopment}
  !insertmacro UnselectSection ${SecPangommDocumentation}

  !insertmacro UnselectSection ${SecAtkmmDevelopment}
  !insertmacro UnselectSection ${SecAtkmmDocumentation}

  !insertmacro UnselectSection ${SecGtkmmDevelopment}
  !insertmacro UnselectSection ${SecGtkmmDemo}
  !insertmacro UnselectSection ${SecGtkmmDocumentation}

  !insertmacro UnselectSection ${SecLibglademmDevelopment}
  !insertmacro UnselectSection ${SecLibglademmDocumentation}
  
  !insertmacro UnselectSection ${SecLibxmlDevelopment}
  !insertmacro UnselectSection ${SecLibxmlDocumentation}
  
!endif
  
  !insertmacro UnselectSection ${SecPost}

FunctionEnd

Function DisableGTKInstaller

;  !insertmacro UnselectSection ${SecGTKInstaller}

  !insertmacro SelectSection ${SecGTKRuntime}
  !insertmacro SelectSection ${SecSigcRuntime}
  !insertmacro SelectSection ${SecCairommRuntime}
  !insertmacro SelectSection ${SecGlibmmRuntime}
  !insertmacro SelectSection ${SecPangommRuntime}
  !insertmacro SelectSection ${SecAtkmmRuntime}
  !insertmacro SelectSection ${SecGtkmmRuntime}
  !insertmacro SelectSection ${SecLibglademmRuntime}
  !insertmacro SelectSection ${SecLibxmlRuntime}

!ifndef RUNTIME_ONLY
  !insertmacro SelectSection ${SecGTKDevelopment}
  !insertmacro SelectSection ${SecGTKDocumentation}

  !insertmacro SelectSection ${SecSigcDevelopment}
  !insertmacro SelectSection ${SecSigcDocumentation}

  !insertmacro SelectSection ${SecCairommDevelopment}
  !insertmacro SelectSection ${SecCairommDocumentation}

  !insertmacro SelectSection ${SecGlibmmDevelopment}
  !insertmacro SelectSection ${SecGlibmmDocumentation}
  
  !insertmacro SelectSection ${SecPangommDevelopment}
  !insertmacro SelectSection ${SecPangommDocumentation}

  !insertmacro SelectSection ${SecAtkmmDevelopment}
  !insertmacro SelectSection ${SecAtkmmDocumentation}

  !insertmacro SelectSection ${SecGtkmmDevelopment}
  !insertmacro SelectSection ${SecGtkmmDemo}
  !insertmacro SelectSection ${SecGtkmmDocumentation}

  !insertmacro SelectSection ${SecLibglademmDevelopment}
  !insertmacro SelectSection ${SecLibglademmDocumentation}
  
  !insertmacro SelectSection ${SecLibxmlDevelopment}
  !insertmacro SelectSection ${SecLibxmlDocumentation}
  
!endif
  
  !insertmacro SelectSection ${SecPost}

FunctionEnd

;--------------------------------
; Custom Page Functions

Function CustomPagePathQuestion

  ClearErrors
!ifdef RUNTIME_ONLY
  !insertmacro MUI_HEADER_TEXT "$(MISC_INSTALL_OPTION)" "$(MISC_ANSWER_SYSTEM)"
  !insertmacro MUI_INSTALLOPTIONS_WRITE "PathQuestion.ini" "Field 1" "Text" "$(GTKMM_ADD_PATH)"
  !insertmacro MUI_INSTALLOPTIONS_DISPLAY "PathQuestion.ini"
!else
  ; always set path in development installer
  IfSilent +2 0
  StrCpy $CB_PATH_VALUE "1"
!endif

FunctionEnd

Function CustomPageSetContext

  ClearErrors
  UserInfo::GetName
  IfErrors continue
  Pop $0
  UserInfo::GetAccountType
  Pop $1
  StrCmp $1 "Admin" 0 done
continue:
  StrCpy $ISADMIN "1"
  IfSilent "" +2
    Goto done

  !insertmacro MUI_HEADER_TEXT "$(MISC_INSTALL_OPTION)" "$(MISC_UNINSTALL_CONTEXT)"
  !insertmacro MUI_INSTALLOPTIONS_WRITE "SetContext.ini" "Field 1" "Text" "$(GTKMM_RIGHTS_INSTALL)"
  !insertmacro MUI_INSTALLOPTIONS_WRITE "SetContext.ini" "Field 2" "Text" "$(GTKMM_RIGHTS_ANYONE)"
  !insertmacro MUI_INSTALLOPTIONS_WRITE "SetContext.ini" "Field 3" "Text" "$(GTKMM_RIGHTS_CURRENT)"
  !insertmacro MUI_INSTALLOPTIONS_DISPLAY "SetContext.ini"
done:
  
FunctionEnd

Function CustomSetTargetDirectory

  IfSilent 0 +2
    StrCmp $USE_GTKDIR "1" 0 done
  ReadRegStr $R0 HKLM Software\${PRODUCT_PLATFORM_NAME}\${PRODUCT_API_VERSION} "Path"
  StrCmp $R0 "" "" done
  ReadRegStr $R0 HKCU Software\${PRODUCT_PLATFORM_NAME}\${PRODUCT_API_VERSION} "Path"
  StrCmp $R0 "" "" done
  ReadRegStr $R0 HKLM "Software\GTK\2.0" "Path"
  StrCmp $R0 "" "" +3
  ReadRegStr $R0 HKCU "Software\GTK\2.0" "Path"
  StrCmp $R0 "" done
  Push $R0
  Pop $INSTDIR
done:

FunctionEnd

Function CustomPreviousVersion

  ; Get installer location
  ClearErrors
  ReadRegStr $R0 HKLM \
  "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_PLATFORM_NAME}" \
  "UninstallString"
  IfErrors 0 +2
  ReadRegStr $R0 HKCU \
  "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_PLATFORM_NAME}" \
  "UninstallString"
  StrCmp $R0 "" done

  ; Get current installed version
  ClearErrors
  ReadRegStr $R1 HKLM \
  "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_PLATFORM_NAME}" \
  "DisplayVersion"
  IfErrors 0 +2
  ReadRegStr $R1 HKCU \
  "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_PLATFORM_NAME}" \
  "DisplayVersion"

  ; Extract package and installer versions
  ${StrTok} $R2 $R1 "-" 0 1
  ${StrTok} $R3 $R1 "-" 1 1
  
  ${VersionCheck} $R2 ${PRODUCT_VERSION} "$R4"
  StrCmp $R4 "1" newerInstall

  StrCmp $R4 "2" +2
  IntCmp $R3 ${PRODUCT_VERSION_INSTALLER} "" "" newerInstall

  IfSilent "" +2
    StrCmp $FORCE_UNINSTALL "1" +2 no_remove_uninstaller
  MessageBox MB_YESNOCANCEL|MB_ICONEXCLAMATION "$(GTKMM_PREVIOUS_VERSION)" IDNO done IDCANCEL abortInstall

  ;Run the uninstaller
  ClearErrors
  CopyFiles "$R0" $TEMP
  StrCpy $R1 ""
  IfSilent 0 +2
    StrCpy $R1 "/S"
  ExecWait '"$TEMP\${GTKMM_UNINSTALL_EXE}" $R1 _?=$INSTDIR'

  IfErrors no_remove_uninstaller
    Delete $R0
    RMDir $INSTDIR

  no_remove_uninstaller:
    Delete "$TEMP\$R0"
    ; Check that the user completed the uninstallation by examining the registry
    ReadRegStr $R0 HKLM \
    "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_PLATFORM_NAME}" \
    "UninstallString"
    IfErrors 0 +2
    ReadRegStr $R0 HKCU \
    "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_PLATFORM_NAME}" \
    "UninstallString"
    StrCmp $R0 "" done abortInstall
    
newerInstall:
    IfSilent +2
      MessageBox MB_OK|MB_ICONEXCLAMATION "$(GTKMM_NEWER)" IDOK ""
    Abort

abortInstall:
    IfSilent 0
      MessageBox MB_OK|MB_ICONEXCLAMATION "$(GTKMM_PREVIOUS_ERROR)"
    Abort

done:
    BringToFront
    
FunctionEnd


;--------------------------------
; Callbacks

;Function .onSelChange
;
;  !insertmacro UnselectSection ${SecGTKInstaller}
;
;FunctionEnd

Function .onInit

  ; Display the language selection dialog
  !insertmacro MUI_LANGDLL_DISPLAY

  ;Extract InstallOptions INI files
  !insertmacro MUI_INSTALLOPTIONS_EXTRACT_AS "NSISLibrary\PathQuestion.ini" "PathQuestion.ini"
  !insertmacro MUI_INSTALLOPTIONS_EXTRACT_AS "NSISLibrary\SetContext.ini" "SetContext.ini"
  
  ; Get Command line Parameters
  Push "ALLUSERS"
  call Cmd_GetParameter
  Pop $CONTEXT
  Push "SET_ENVVARS"
  call Cmd_GetParameter
  Pop $CB_PATH_VALUE
  Push "FORCE_UNINSTALL"
  call Cmd_GetParameter
  Pop $FORCE_UNINSTALL
  Push "USE_GTKDIR"
  call Cmd_GetParameter
  Pop $USE_GTKDIR
  
  IfSilent "" +5
    StrCpy $ICONS_GROUP "Gtkmm"
    Call CustomPreviousVersion
    Call CustomSetTargetDirectory
    Call CustomPagePathQuestion
    Call CustomPageSetContext

FunctionEnd

Function un.onInit

  !insertmacro MUI_UNGETLANGUAGE

FunctionEnd