Debian Codegraph @

altosui/Instdrv/NSIS/Contrib/InstDrv/Example.nsi

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