-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathsetup.iss
More file actions
72 lines (63 loc) · 2.57 KB
/
Copy pathsetup.iss
File metadata and controls
72 lines (63 loc) · 2.57 KB
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
#define AppName "Switch Input Language"
#define AppVersion "3.1.2"
#define AppExe "SwitchInputLanguage.exe"
#define AppPublisher "LXRJ"
[Setup]
AppId={{A3F2C1D0-4B5E-4F6A-8C9D-1E2F3A4B5C6D}
AppName={#AppName}
AppVersion={#AppVersion}
AppPublisherURL=https://github.com/sumonchai/Switch-Input-Language
AppPublisher={#AppPublisher}
DefaultDirName={autopf}\{#AppName}
DefaultGroupName={#AppName}
OutputDir=dist
OutputBaseFilename=SwitchInputLanguage_Setup_{#AppVersion}
SetupIconFile=src\media\LJ LOGO.ico
Compression=lzma2/ultra64
SolidCompression=yes
WizardStyle=modern
PrivilegesRequired=lowest
UninstallDisplayIcon={app}\{#AppExe}
DisableWelcomePage=no
DisableDirPage=no
DisableReadyPage=no
ArchitecturesAllowed=x64compatible
ArchitecturesInstallIn64BitMode=x64compatible
CloseApplications=yes
CloseApplicationsFilter=*{#AppExe}
RestartApplications=no
[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"
[Tasks]
Name: "startup"; Description: "เริ่มทำงานอัตโนมัติเมื่อ Windows เปิด"; GroupDescription: "ตัวเลือกเพิ่มเติม:"; Flags: unchecked
[Files]
Source: "out\{#AppExe}"; DestDir: "{app}"; Flags: ignoreversion
Source: "out\{#AppExe}.config"; DestDir: "{app}"; Flags: ignoreversion
Source: "out\media\LJ LOGO.ico"; DestDir: "{app}\media"; Flags: ignoreversion
[Icons]
Name: "{userdesktop}\{#AppName}"; Filename: "{app}\{#AppExe}"
Name: "{group}\{#AppName}"; Filename: "{app}\{#AppExe}"; IconFilename: "{app}\media\LJ LOGO.ico"
Name: "{group}\Uninstall {#AppName}"; Filename: "{uninstallexe}"
[Registry]
Root: HKCU; Subkey: "Software\Microsoft\Windows\CurrentVersion\Run"; ValueType: string; ValueName: "SwitchInputLanguage"; ValueData: """{app}\{#AppExe}"""; Flags: uninsdeletevalue; Tasks: startup
[Run]
Filename: "{app}\{#AppExe}"; Description: "เปิดโปรแกรม"; Flags: nowait postinstall skipifsilent
[UninstallRun]
Filename: "taskkill"; Parameters: "/IM {#AppExe} /F"; Flags: runhidden; RunOnceId: "KillApp"
[Code]
procedure CurStepChanged(CurStep: TSetupStep);
var
UninstPath: String;
UninstExe: String;
ResultCode: Integer;
begin
if CurStep = ssInstall then
begin
UninstPath := ExpandConstant('Software\Microsoft\Windows\CurrentVersion\Uninstall\{#SetupSetting("AppId")}_is1');
if RegQueryStringValue(HKCU, UninstPath, 'UninstallString', UninstExe) or
RegQueryStringValue(HKLM, UninstPath, 'UninstallString', UninstExe) then
begin
Exec(RemoveQuotes(UninstExe), '/SILENT /NORESTART', '', SW_HIDE, ewWaitUntilTerminated, ResultCode);
end;
end;
end;