-
Notifications
You must be signed in to change notification settings - Fork 23
/
cabocha.iss.in
125 lines (115 loc) · 4.41 KB
/
cabocha.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
[Setup]
AppName=CaboCha
AppVersion=@VERSION@
AppVerName=CaboCha @VERSION@
DefaultDirName={pf}\CaboCha
AllowNoIcons=Yes
DefaultGroupName=CaboCha
LicenseFile=BSD
Compression=bzip
OutputBaseFileName=cabocha-@VERSION@
OutputDir=.
AppPublisher=Taku Kudo
AppPublisherURL=http://cabocha.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: "BSD"; DestDir: "{app}"
Source: "src\cabocha.exe"; DestDir: "{app}\bin"
Source: "src\cabocha-model-index.exe"; DestDir: "{app}\bin"
Source: "src\cabocha-system-eval.exe"; DestDir: "{app}\bin"
Source: "src\cabocha-learn.exe"; DestDir: "{app}\bin"
Source: "src\libcabocha.dll"; DestDir: "{app}\bin"
Source: "src\win32\libcrfpp.dll"; DestDir: "{app}\bin"
Source: "wintmp\cabocharc"; DestDir: "{app}\etc"
Source: "src\libcabocha.lib"; DestDir: "{app}\sdk"
Source: "src\libcabocha.dll"; DestDir: "{app}\bin"
Source: "wintmp\*.c"; DestDir: "{app}\sdk"
Source: "wintmp\*.cpp"; DestDir: "{app}\sdk"
Source: "src\cabocha.h"; DestDir: "{app}\sdk"
Source: "wintmp\model\*.ipa.txt"; DestDir: "{app}\model"
Source: "model\mkmodel.bat"; DestDir: "{app}\model"
[Icons]
Name: "{commonprograms}\CaboCha\CaboCha"; Filename: "{app}\bin\cabocha.exe"
Name: "{commonprograms}\CaboCha\Recompile SHIFT-JIS Model"; WorkingDir: "{app}\model"; Filename: "{app}\model\mkmodel.bat"; Parameters: "SHIFT-JIS"; Comment: "Recompile SHIFT-JIS Model"
Name: "{commonprograms}\CaboCha\Recompile UTF-8 Dictionary"; WorkingDir: "{app}\model"; Filename: "{app}\model\mkmodel.bat"; Parameters: "UTF-8"; Comment: "Recompile UTF-8 model"
Name: "{commonprograms}\CaboCha\Uninstall CaboCha"; Filename: "{app}\unins000.exe"
Name: "{commonprograms}\CaboCha\CaboCha Document"; Filename: "{app}\doc\index.html"
Name: "{userdesktop}\CaboCha"; Filename: "{app}\bin\cabocha.exe"
[Run]
Filename: "{app}\model\mkmodel.bat"; Parameters: "{code:GetCharCode}"; WorkingDir: "{app}\model"
[UninstallDelete]
Type: files; Name: "{app}\model\*.model"
Type: files; Name: "{app}\model\charset-file.txt"
[Registry]
Root: HKLM; Subkey: "software\CaboCha"; Flags: uninsdeletekey; ValueType: string; ValueName: "cabocharc"; ValueData: "{app}\etc\cabocharc" ; Check: IsAdmin
Root: HKCU; Subkey: "software\CaboCha"; Flags: uninsdeletekey; ValueType: string; ValueName: "cabocharc"; ValueData: "{app}\etc\cabocharc"
[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 CaboCha';
if ActiveLanguage = 'jp' then
begin
conf := '管理者権限をお持ちのようです。このコンピュータの全ユーザにCaboChaの実行を許可しますか?';
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 CaboCha dictionary. It will take 30-60secs.';
if ActiveLanguage = 'jp' then
begin
msg := 'CaboChaの辞書を作成します。作業には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;
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.Values[0] := True;
end;