; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
[Setup]
; NOTE: The value of AppId uniquely identifies this application.
; Do not use the same AppId value in installers for other applications.
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
AppCopyright=TeamGPS
AppId={{8CB5EA8F-DCE8-428A-B848-502B097D7F12}
AppName=GPSShogi
AppVerName=GPSShogi @20100227
AppPublisher=TeamGPS
AppPublisherURL=http://gps.tanaka.ecc.u-tokyo.ac.jp/gpsshogi/
AppSupportURL=http://gps.tanaka.ecc.u-tokyo.ac.jp/gpsshogi/
AppUpdatesURL=http://gps.tanaka.ecc.u-tokyo.ac.jp/gpsshogi/
DefaultDirName={pf}\gpsshogi
DefaultGroupName=GPSShogi
LicenseFile=gpsshogi\single\COPYING
OutputDir=R:\
OutputBaseFilename=setup_gpsshogi_20100227
Compression=lzma
SolidCompression=yes
UsePreviousAppDir=no
VersionInfoDescription=GPSShogi

[Languages]
Name: "japanese"; MessagesFile: "compiler:Languages\Japanese.isl"
Name: "english"; MessagesFile: "compiler:Default.isl"

[Files]
Source: "README.txt";   DestDir: "{app}"; Flags: ignoreversion
Source: "README.ja.txt";   DestDir: "{app}"; Flags: ignoreversion
; data
Source: "gpsshogi\data\*";   DestDir: "{app}\data"; Flags: ignoreversion recursesubdirs
; single
Source: "gpsshogi\single\*"; DestDir: "{app}\single"; Flags: ignoreversion recursesubdirs
; smp
Source: "gpsshogi\smp\*";    DestDir: "{app}\smp"; Flags: ignoreversion recursesubdirs
; NOTE: Don't use "Flags: ignoreversion" on any shared system files

[Icons]
Name: "{group}\{cm:UninstallProgram,GPSShogi}"; Filename: "{uninstallexe}"

[Registry]
Root: HKCU; Subkey: "Environment"; ValueType: string; ValueName: "OSL_HOME"; ValueData: "{app}"; Flags: deletevalue uninsdeletevalue; AfterInstall: SynchronizeEnvironment

[Code]
function SendMessageTimeoutA(hWnd, msg, wParam: Longint; lParam: String; fuFlags, uTimeout: Longint; lpdwResult: Longint): Longint;
external 'SendMessageTimeoutA@user32.dll stdcall';
procedure SynchronizeEnvironment();
var
updateRes: Longint;
begin
{ SendMessageTimeoutA(HWND_BROADCAST, WM_SETTINGCHANGE, 0, 'Environment', SMTO_ABORTIFHUNG, 5000, 0) }
updateRes := SendMessageTimeoutA($FFFF, $1A, 0, 'Environment', $2, 5000, 0);
end;
