Merge branch 'master' of git://git.gag.com/fw/altos
[fw/altos] / ao-tools / altosui / Instdrv / NSIS / Contrib / InstDrv / Example.nsi
1 #\r
2 # InstDrv Example, (c) 2003 Jan Kiszka (Jan Kiszka@web.de)\r
3 #\r
4 \r
5 Name "InstDrv.dll test"\r
6 \r
7 OutFile "InstDrv-Test.exe"\r
8 \r
9 ShowInstDetails show\r
10 \r
11 ComponentText "InstDrv Plugin Usage Example"\r
12 \r
13 Page components\r
14 Page instfiles\r
15 \r
16 Section "Install a Driver" InstDriver\r
17     InstDrv::InitDriverSetup /NOUNLOAD "{4d36e978-e325-11ce-bfc1-08002be10318}" "IrCOMM2k"\r
18     Pop $0\r
19     DetailPrint "InitDriverSetup: $0"\r
20 \r
21     InstDrv::DeleteOemInfFiles /NOUNLOAD\r
22     Pop $0\r
23     DetailPrint "DeleteOemInfFiles: $0"\r
24     StrCmp $0 "00000000" PrintInfNames ContInst1\r
25 \r
26   PrintInfNames:\r
27     Pop $0\r
28     DetailPrint "Deleted $0"\r
29     Pop $0\r
30     DetailPrint "Deleted $0"\r
31 \r
32   ContInst1:\r
33     InstDrv::CreateDevice /NOUNLOAD\r
34     Pop $0\r
35     DetailPrint "CreateDevice: $0"\r
36 \r
37     SetOutPath $TEMP\r
38     File "ircomm2k.inf"\r
39     File "ircomm2k.sys"\r
40 \r
41     InstDrv::InstallDriver /NOUNLOAD "$TEMP\ircomm2k.inf"\r
42     Pop $0\r
43     DetailPrint "InstallDriver: $0"\r
44     StrCmp $0 "00000000" PrintReboot ContInst2\r
45 \r
46   PrintReboot:\r
47     Pop $0\r
48     DetailPrint "Reboot: $0"\r
49 \r
50   ContInst2:\r
51     InstDrv::CountDevices\r
52     Pop $0\r
53     DetailPrint "CountDevices: $0"\r
54 SectionEnd\r
55 \r
56 Section "Uninstall the driver again" UninstDriver\r
57     InstDrv::InitDriverSetup /NOUNLOAD "{4d36e978-e325-11ce-bfc1-08002be10318}" "IrCOMM2k"\r
58     Pop $0\r
59     DetailPrint "InitDriverSetup: $0"\r
60 \r
61     InstDrv::DeleteOemInfFiles /NOUNLOAD\r
62     Pop $0\r
63     DetailPrint "DeleteOemInfFiles: $0"\r
64     StrCmp $0 "00000000" PrintInfNames ContUninst1\r
65 \r
66   PrintInfNames:\r
67     Pop $0\r
68     DetailPrint "Deleted $0"\r
69     Pop $0\r
70     DetailPrint "Deleted $0"\r
71 \r
72   ContUninst1:\r
73     InstDrv::RemoveAllDevices\r
74     Pop $0\r
75     DetailPrint "RemoveAllDevices: $0"\r
76     StrCmp $0 "00000000" PrintReboot ContUninst2\r
77 \r
78   PrintReboot:\r
79     Pop $0\r
80     DetailPrint "Reboot: $0"\r
81 \r
82   ContUninst2:\r
83     Delete "$SYSDIR\system32\ircomm2k.sys"\r
84 SectionEnd