-
Notifications
You must be signed in to change notification settings - Fork 18
/
wiasane.iss
169 lines (169 loc) · 10.9 KB
/
wiasane.iss
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
#ifndef Configuration
#define Configuration "Release"
#endif
#if Configuration == "Release"
#define RedistSuffix "110"
#define RedistDir32bit "C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\redist\x86\Microsoft.VC110.CRT"
#define RedistDir64bit "C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\redist\x64\Microsoft.VC110.CRT"
#define SourceDir32bit "wiasane-pkg\Release\Win32\wiasane-pkg"
#define SourceDir64bit "wiasane-pkg\Release\x64\wiasane-pkg"
#endif
#if Configuration == "Debug"
#define RedistSuffix "110d"
#define RedistDir32bit "C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\redist\Debug_NonRedist\x86\Microsoft.VC110.DebugCRT"
#define RedistDir64bit "C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\redist\Debug_NonRedist\x64\Microsoft.VC110.DebugCRT"
#define SourceDir32bit "wiasane-pkg\Debug\Win32\wiasane-pkg"
#define SourceDir64bit "wiasane-pkg\Debug\x64\wiasane-pkg"
#endif
[Files]
Source: {#RedistDir32bit}\msvcp{#RedistSuffix}.dll; DestDir: {sys}; Flags: onlyifdoesntexist sharedfile uninsnosharedfileprompt uninsrestartdelete 32bit; Check: Not Is64BitInstallMode
Source: {#RedistDir32bit}\msvcr{#RedistSuffix}.dll; DestDir: {sys}; Flags: onlyifdoesntexist sharedfile uninsnosharedfileprompt uninsrestartdelete 32bit; Check: Not Is64BitInstallMode
Source: {#SourceDir32bit}\winsane-util.dll; DestDir: {app}; Flags: overwritereadonly replacesameversion restartreplace uninsrestartdelete 32bit; Check: Not Is64BitInstallMode
Source: {#SourceDir32bit}\winsane.dll; DestDir: {app}; Flags: overwritereadonly replacesameversion restartreplace uninsrestartdelete 32bit; Check: Not Is64BitInstallMode
Source: {#SourceDir32bit}\wiasane.dll; DestDir: {app}; Flags: overwritereadonly replacesameversion restartreplace uninsrestartdelete 32bit; Check: Not Is64BitInstallMode
Source: {#SourceDir32bit}\coisane.dll; DestDir: {app}; Flags: overwritereadonly replacesameversion restartreplace uninsrestartdelete 32bit; Check: Not Is64BitInstallMode
Source: {#SourceDir32bit}\devsane.exe; DestDir: {app}; Flags: overwritereadonly replacesameversion restartreplace uninsrestartdelete 32bit; Check: Not Is64BitInstallMode
Source: {#SourceDir32bit}\wiasane.inf; DestDir: {app}; Flags: overwritereadonly replacesameversion restartreplace uninsrestartdelete 32bit; Check: Not Is64BitInstallMode
Source: {#SourceDir32bit}\wiasane.cat; DestDir: {app}; Flags: overwritereadonly replacesameversion restartreplace uninsrestartdelete 32bit; Check: Not Is64BitInstallMode
Source: {#SourceDir32bit}\winsane-dbg.exe; DestDir: {app}; Flags: overwritereadonly replacesameversion restartreplace uninsrestartdelete 32bit; Check: Not Is64BitInstallMode
Source: {#RedistDir64bit}\msvcp{#RedistSuffix}.dll; DestDir: {sys}; Flags: onlyifdoesntexist sharedfile uninsnosharedfileprompt uninsrestartdelete 64bit; Check: Is64BitInstallMode
Source: {#RedistDir64bit}\msvcr{#RedistSuffix}.dll; DestDir: {sys}; Flags: onlyifdoesntexist sharedfile uninsnosharedfileprompt uninsrestartdelete 64bit; Check: Is64BitInstallMode
Source: {#SourceDir64bit}\winsane-util.dll; DestDir: {app}; Flags: overwritereadonly replacesameversion restartreplace uninsrestartdelete 64bit; Check: Is64BitInstallMode
Source: {#SourceDir64bit}\winsane.dll; DestDir: {app}; Flags: overwritereadonly replacesameversion restartreplace uninsrestartdelete 64bit; Check: Is64BitInstallMode
Source: {#SourceDir64bit}\wiasane.dll; DestDir: {app}; Flags: overwritereadonly replacesameversion restartreplace uninsrestartdelete 64bit; Check: Is64BitInstallMode
Source: {#SourceDir64bit}\coisane.dll; DestDir: {app}; Flags: overwritereadonly replacesameversion restartreplace uninsrestartdelete 64bit; Check: Is64BitInstallMode
Source: {#SourceDir64bit}\devsane.exe; DestDir: {app}; Flags: overwritereadonly replacesameversion restartreplace uninsrestartdelete 64bit; Check: Is64BitInstallMode
Source: {#SourceDir64bit}\wiasane.inf; DestDir: {app}; Flags: overwritereadonly replacesameversion restartreplace uninsrestartdelete 64bit; Check: Is64BitInstallMode
Source: {#SourceDir64bit}\wiasane.cat; DestDir: {app}; Flags: overwritereadonly replacesameversion restartreplace uninsrestartdelete 64bit; Check: Is64BitInstallMode
Source: {#SourceDir64bit}\winsane-dbg.exe; DestDir: {app}; Flags: overwritereadonly replacesameversion restartreplace uninsrestartdelete 64bit; Check: Is64BitInstallMode
[Icons]
Name: {group}\{cm:StartInstallDevice}; Filename: {app}\devsane.exe; Parameters: device install wiasane.inf; WorkingDir: {app}; IconFilename: sti.dll
Name: {group}\{cm:StartUninstallDriver}; Filename: {uninstallexe}; IconFilename: devmgr.dll; IconIndex: 4
[Setup]
OutputDir=.
MinVersion=6.0.6001
ArchitecturesInstallIn64BitMode=x64
ArchitecturesAllowed=x86 x64
AppID={{B7D5E900-AF40-11DD-AD8B-0800200C9A65}
AppCopyright=Copyright (C) 2012-2016 Marc Hörsken. All rights reserved.
AppPublisher=Marc Hörsken
AppPublisherURL=http://wiasane.marc-hoersken.de/
AppName=Scanner Access Now Easy - WIA Driver
AppVersion=0.1.2.10
VersionInfoVersion=0.1.2.10
DefaultDirName={pf}\SANE WIA Driver
DefaultGroupName=SANE WIA Driver
OutputBaseFilename=wiasane
ShowLanguageDialog=no
WizardImageFile=compiler:wizmodernimage.bmp
WizardSmallImageFile=compiler:wizmodernsmallimage.bmp
LicenseFile=COPYING
CloseApplications=no
SolidCompression=yes
SignTool=signtool
[UninstallDelete]
Name: {app}; Type: filesandordirs
[Languages]
Name: English; MessagesFile: compiler:Default.isl
Name: German; MessagesFile: compiler:Languages\German.isl
[CustomMessages]
StartInstallDevice=Install scanner
StartUninstallDevice=Uninstall scanners
StartUninstallDriver=Uninstall driver
InstallDriver=Installing driver ...
InstallDevice=Installing device ...
UninstallDevice=Uninstalling devices ...
UninstallDriver=Uninstalling driver ...
FailedInstallDriver=Installation of driver failed!%n%nError = %1%n%nError Code = %2
FailedInstallDevice=Installation of device failed!%n%nError = %1%n%nError Code = %2
FailedUninstallDevice=Uninstallation of devices failed!%n%nError = %1%n%nError Code = %2
FailedUninstallDriver=Uninstallation of driver failed!%n%nError = %1%n%nError Code = %2
FinishInstallAction=Please execute the "Finish installing device software" action within the info area resp. system tray.
German.StartInstallDevice=Scanner installieren
German.StartUninstallDevice=Scanner deinstallieren
German.StartUninstallDriver=Treiber deinstallieren
German.InstallDriver=Installiere Treiber ...
German.InstallDevice=Installiere Gerät ...
German.UninstallDevice=Deinstalliere Geräte ...
German.UninstallDriver=Deinstalliere Treiber ...
German.FailedInstallDriver=Installation des Treibers fehlgeschlagen!%n%nFehler = %1%n%nFehler Code = %2
German.FailedInstallDevice=Installation des Geräts fehlgeschlagen!%n%nFehler = %1%n%nFehler Code = %2
German.FailedUninstallDevice=Deinstallation der Geräte fehlgeschlagen!%n%nFehler = %1%n%nFehler Code = %2
German.FailedUninstallDriver=Deinstallation des Treibers fehlgeschlagen!%n%nFehler = %1%n%nFehler Code = %2
German.FinishInstallAction=Bitte die Aktion "Installation der Gerätesoftware abschließen" im Infobereich bzw. System Tray ausführen.
[Code]
const
ERROR_NO_SUCH_DEVINST = $E000020B;
ERROR_DRIVER_PACKAGE_NOT_IN_STORE = $E0000302;
procedure CurStepChanged(CurStep: TSetupStep);
var
ResultCode: integer;
StatusLabel: string;
begin
if CurStep = ssInstall then
begin
StatusLabel := WizardForm.StatusLabel.Caption;
if FileExists(ExpandConstant('{app}\devsane.exe')) and FileExists(ExpandConstant('{app}\wiasane.inf')) then
begin
WizardForm.StatusLabel.Caption := CustomMessage('UninstallDriver');
if not Exec(ExpandConstant('{app}\devsane.exe'), ExpandConstant('driver uninstall wiasane.inf'), ExpandConstant('{app}'), SW_HIDE, ewWaitUntilTerminated, ResultCode)
or ((ResultCode <> 0) and (ResultCode <> ERROR_DRIVER_PACKAGE_NOT_IN_STORE)) then
RaiseException(FmtMessage(CustomMessage('FailedUninstallDriver'), [SysErrorMessage(ResultCode), Format('%.8x', [ResultCode])]))
else
Sleep(1000);
end;
WizardForm.StatusLabel.Caption := StatusLabel;
end
else if CurStep = ssPostInstall then
begin
StatusLabel := WizardForm.StatusLabel.Caption;
WizardForm.StatusLabel.Caption := CustomMessage('InstallDriver');
if not Exec(ExpandConstant('{app}\devsane.exe'), ExpandConstant('driver install wiasane.inf {hwnd}'), ExpandConstant('{app}'), SW_SHOW, ewWaitUntilTerminated, ResultCode)
or ((ResultCode <> 0) and (ResultCode <> ERROR_NO_SUCH_DEVINST)) then
RaiseException(FmtMessage(CustomMessage('FailedInstallDriver'), [SysErrorMessage(ResultCode), Format('%.8x', [ResultCode])]))
else
Sleep(500);
if ResultCode = ERROR_NO_SUCH_DEVINST then
begin
WizardForm.StatusLabel.Caption := CustomMessage('InstallDevice');
if not Exec(ExpandConstant('{app}\devsane.exe'), ExpandConstant('device install wiasane.inf {hwnd}'), ExpandConstant('{app}'), SW_SHOW, ewWaitUntilTerminated, ResultCode)
or (ResultCode <> 0) then
RaiseException(FmtMessage(CustomMessage('FailedInstallDevice'), [SysErrorMessage(ResultCode), Format('%.8x', [ResultCode])]))
else
begin
Sleep(500);
if GetWindowsVersion >= $06020000 then
begin
if not Exec(ExpandConstant('{sys}\newdev.exe'), '6', ExpandConstant('{sys}'), SW_SHOW, ewWaitUntilTerminated, ResultCode)
then MsgBox(CustomMessage('FinishInstallAction'), mbInformation, MB_OK);
end;
end;
end;
WizardForm.StatusLabel.Caption := StatusLabel;
end;
end;
procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep);
var
ResultCode: integer;
StatusLabel: string;
begin
if CurUninstallStep = usUninstall then
begin
StatusLabel := UninstallProgressForm.StatusLabel.Caption;
UninstallProgressForm.StatusLabel.Caption := CustomMessage('UninstallDevice');
if not Exec(ExpandConstant('{app}\devsane.exe'), ExpandConstant('device uninstall wiasane.inf'), ExpandConstant('{app}'), SW_HIDE, ewWaitUntilTerminated, ResultCode)
or ((ResultCode <> 0) and (ResultCode <> ERROR_DRIVER_PACKAGE_NOT_IN_STORE)) then
RaiseException(FmtMessage(CustomMessage('FailedUninstallDevice'), [SysErrorMessage(ResultCode), Format('%.8x', [ResultCode])]))
else
Sleep(500);
UninstallProgressForm.StatusLabel.Caption := CustomMessage('UninstallDriver');
if not Exec(ExpandConstant('{app}\devsane.exe'), ExpandConstant('driver uninstall wiasane.inf'), ExpandConstant('{app}'), SW_HIDE, ewWaitUntilTerminated, ResultCode)
or ((ResultCode <> 0) and (ResultCode <> ERROR_DRIVER_PACKAGE_NOT_IN_STORE)) then
RaiseException(FmtMessage(CustomMessage('FailedUninstallDriver'), [SysErrorMessage(ResultCode), Format('%.8x', [ResultCode])]))
else
Sleep(500);
UninstallProgressForm.StatusLabel.Caption := StatusLabel;
end;
end;
[_ISTool]
UseAbsolutePaths=false