-
Notifications
You must be signed in to change notification settings - Fork 4
/
mecab.iss.in
executable file
·141 lines (130 loc) · 5.17 KB
/
mecab.iss.in
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
[Setup]
AppName=MeCab
AppVersion=@VERSION@
AppVerName=MeCab @VERSION@
DefaultDirName={pf}\MeCab
AllowNoIcons=Yes
DefaultGroupName=MeCab
LicenseFile=BSD
Compression=bzip
OutputBaseFileName=mecab-@VERSION@
OutputDir=.
AppPublisher=Taku Kudo
AppPublisherURL=http://mecab.sourceforge.net/
ShowLanguageDialog=yes
[Languages]
Name: "en"; MessagesFile: "compiler:Default.isl"
Name: "jp"; MessagesFile: "compiler:Japanese.isl"
[Files]
Source: "AUTHORS"; DestDir: "{app}"
Source: "COPYING"; DestDir: "{app}"
Source: "GPL"; DestDir: "{app}"
Source: "LGPL"; DestDir: "{app}"
Source: "BSD"; DestDir: "{app}"
Source: "src\mecab.exe"; DestDir: "{app}\bin"
Source: "src\mecab-*-*.exe"; DestDir: "{app}\bin"
Source: "src\libmecab.dll"; DestDir: "{app}\bin"
Source: "wintmp\mecabrc"; DestDir: "{app}\etc"
Source: "src\libmecab.lib"; DestDir: "{app}\sdk"
Source: "src\libmecab.dll"; DestDir: "{app}\bin"
Source: "wintmp\*.c"; DestDir: "{app}\sdk"
Source: "wintmp\*.cpp"; DestDir: "{app}\sdk"
Source: "src\mecab.h"; DestDir: "{app}\sdk"
Source: "doc\*.html"; DestDir: "{app}\doc"
Source: "doc\*.png"; DestDir: "{app}\doc"
Source: "doc\*.css"; DestDir: "{app}\doc"
Source: "wintmp\dic\*.csv"; DestDir: "{app}\dic\ipadic"
Source: "wintmp\dic\*.def"; DestDir: "{app}\dic\ipadic"
Source: "wintmp\dic\dicrc"; DestDir: "{app}\dic\ipadic"
[Icons]
Name: "{commonprograms}\MeCab\MeCab"; Filename: "{app}\bin\mecab.exe"
Name: "{commonprograms}\MeCab\Recompile SHIFT-JIS Dictionary"; WorkingDir: "{app}\dic\ipadic"; Filename: "{app}\bin\mecab-dict-index.exe"; Parameters: "-f SHIFT-JIS -t SHIFT-JIS"; Comment: "Recompile SHIFT-JIS dictionary"
Name: "{commonprograms}\MeCab\Recompile UTF-8 Dictionary"; WorkingDir: "{app}\dic\ipadic"; Filename: "{app}\bin\mecab-dict-index.exe"; Parameters: "-f SHIFT-JIS -t UTF-8"; Comment: "Recompile UTF-8 dictionary"
Name: "{commonprograms}\MeCab\Recompile UTF-16 Dictionary"; WorkingDir: "{app}\dic\ipadic"; Filename: "{app}\bin\mecab-dict-index.exe"; Parameters: "-f SHIFT-JIS -t UTF-16"; Comment: "Recompile UTF-16 dictionary"
Name: "{commonprograms}\MeCab\Recompile EUC-JP Dictionary"; WorkingDir: "{app}\dic\ipadic"; Filename: "{app}\bin\mecab-dict-index.exe"; Parameters: "-f SHIFT-JIS -t EUC-JP"; Comment: "Recompile EUC-JP dictionary"
Name: "{commonprograms}\MeCab\Uninstall MeCab"; Filename: "{app}\unins000.exe"
Name: "{commonprograms}\MeCab\MeCab Document"; Filename: "{app}\doc\index.html"
Name: "{userdesktop}\MeCab"; Filename: "{app}\bin\mecab.exe"
[Run]
Filename: "{app}\bin\mecab-dict-index.exe"; Parameters: "-f SHIFT-JIS -t {code:GetCharCode}"; WorkingDir: "{app}\dic\ipadic"
[UninstallDelete]
Type: files; Name: "{app}\dic\ipadic\*.bin"
Type: files; Name: "{app}\dic\ipadic\*.dic"
[Registry]
Root: HKLM; Subkey: "software\MeCab"; Flags: uninsdeletekey; ValueType: string; ValueName: "mecabrc"; ValueData: "{app}\etc\mecabrc" ; Check: IsAdmin
Root: HKCU; Subkey: "software\MeCab"; Flags: uninsdeletekey; ValueType: string; ValueName: "mecabrc"; ValueData: "{app}\etc\mecabrc"
[Code]
Program Setup;
var
IsAdminFlg: boolean;
IsAdminCheckedFlg: boolean;
UserPage: TInputOptionWizardPage;
Function IsAdmin (): Boolean;
var
conf: String;
begin
if not IsAdminLoggedOn () then
begin
Result := false;
end
else
begin
conf := 'You have administrator privileges. Do you permit all users to run MeCab';
if ActiveLanguage = 'jp' then
begin
conf := '管理者権限をお持ちのようです。このコンピュータの全ユーザにMeCabの実行を許可しますか?';
end
if not IsAdminCheckedFlg then
IsAdminFlg := MsgBox (conf, mbInformation, mb_YesNo) = idYes;
IsAdminCheckedFlg := true;
Result := IsAdminFlg;
end;
end;
Function GetCharCode (Param: String): String;
var
msg: String;
begin
msg := 'Start compiling MeCab dictionary. It will take 30-60secs.';
if ActiveLanguage = 'jp' then
begin
msg := 'MeCabの辞書を作成します。作業には1分ほどかかる場合がございます。';
end;
MsgBox(msg, mbInformation, mb_OK);
Result := 'SHIFT-JIS';
if UserPage.Values[0] = True then
begin
Result := 'SHIFT-JIS';
end;
if UserPage.Values[1] = True then
begin
Result := 'UTF-8';
end;
if UserPage.Values[2] = True then
begin
Result := 'UTF-16';
end;
if UserPage.Values[3] = True then
begin
Result := 'EUC-JP';
end;
end;
procedure InitializeWizard;
var
msg : array[0..3] of String;
begin
msg[0] := 'Dictionary Charset'
msg[1] := 'Please choose character set';
msg[2] := 'Please specify charset set of dictionary, then click Next.';
if ActiveLanguage = 'jp' then
begin
msg[0] := '辞書の文字コードの選択'
msg[1] := '辞書の文字コードを選択してください。';
msg[2] := 'インストールする辞書の文字コードを選択し(通常はSHIFT-JIS)、次へをクリックしてください。';
end;
UserPage := CreateInputOptionPage(wpWelcome, msg[0], msg[1], msg[2], True, True);
UserPage.Add('SHIFT-JIS');
UserPage.Add('UTF-8');
UserPage.Add('UTF-16');
UserPage.Add('EUC-JP');
UserPage.Values[0] := True;
end;