summaryrefslogtreecommitdiff
path: root/altosui/Instdrv/NSIS/Contrib/InstDrv/Example.nsi
blob: 3ed821ebe8b857c4b02e79b7fff0cb9b21021a43 (plain) (blame)
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
#
# InstDrv Example, (c) 2003 Jan Kiszka (Jan Kiszka@web.de)
#

Name "InstDrv.dll test"

OutFile "InstDrv-Test.exe"

ShowInstDetails show

ComponentText "InstDrv Plugin Usage Example"

Page components
Page instfiles

Section "Install a Driver" InstDriver
    InstDrv::InitDriverSetup /NOUNLOAD "{4d36e978-e325-11ce-bfc1-08002be10318}" "IrCOMM2k"
    Pop $0
    DetailPrint "InitDriverSetup: $0"

    InstDrv::DeleteOemInfFiles /NOUNLOAD
    Pop $0
    DetailPrint "DeleteOemInfFiles: $0"
    StrCmp $0 "00000000" PrintInfNames ContInst1

  PrintInfNames:
    Pop $0
    DetailPrint "Deleted $0"
    Pop $0
    DetailPrint "Deleted $0"

  ContInst1:
    InstDrv::CreateDevice /NOUNLOAD
    Pop $0
    DetailPrint "CreateDevice: $0"

    SetOutPath $TEMP
    File "ircomm2k.inf"
    File "ircomm2k.sys"

    InstDrv::InstallDriver /NOUNLOAD "$TEMP\ircomm2k.inf"
    Pop $0
    DetailPrint "InstallDriver: $0"
    StrCmp $0 "00000000" PrintReboot ContInst2

  PrintReboot:
    Pop $0
    DetailPrint "Reboot: $0"

  ContInst2:
    InstDrv::CountDevices
    Pop $0
    DetailPrint "CountDevices: $0"
SectionEnd

Section "Uninstall the driver again" UninstDriver
    InstDrv::InitDriverSetup /NOUNLOAD "{4d36e978-e325-11ce-bfc1-08002be10318}" "IrCOMM2k"
    Pop $0
    DetailPrint "InitDriverSetup: $0"

    InstDrv::DeleteOemInfFiles /NOUNLOAD
    Pop $0
    DetailPrint "DeleteOemInfFiles: $0"
    StrCmp $0 "00000000" PrintInfNames ContUninst1

  PrintInfNames:
    Pop $0
    DetailPrint "Deleted $0"
    Pop $0
    DetailPrint "Deleted $0"

  ContUninst1:
    InstDrv::RemoveAllDevices
    Pop $0
    DetailPrint "RemoveAllDevices: $0"
    StrCmp $0 "00000000" PrintReboot ContUninst2

  PrintReboot:
    Pop $0
    DetailPrint "Reboot: $0"

  ContUninst2:
    Delete "$SYSDIR\system32\ircomm2k.sys"
SectionEnd