; Script generated by the My Inno Setup Extensions Script Wizard. ; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES! [Setup] AppName =GNU Aspell AppVerName =GNU Aspell 0.50-3 AppPublisher =GNU AppPublisherURL =http://aspell.net AppSupportURL =http://mail.gnu.org/mailman/listinfo/aspell-user AppUpdatesURL =http://aspell.net/win32 DefaultDirName ={pf}\Aspell DefaultGroupName =Aspell AllowNoIcons =yes ;LicenseFile =..\..\_doc-0-50-3\COPYING InfoBeforeFile =..\..\aspell-0-50-3\COPYING InfoAfterFile =Install-win32.txt DirExistsWarning =no DisableStartupPrompt =yes OutputBaseFilename =Aspell-0-50-3-Setup [Tasks] Name: "desktopicon"; Description: "Create a &desktop icon (drag a file from the explorer onto it)"; GroupDescription: "Additional icons:"; Flags: unchecked; Name: "sendtoicon"; Description: "Create a &send-to link (right click on a file and send it to aspell)"; GroupDescription: "Additional icons:"; Flags: unchecked; [Files] ; binaries Source: "aspell.exe"; DestDir: "{app}\bin"; CopyMode: alwaysoverwrite Source: "aspell-15.dll"; DestDir: "{app}\bin"; CopyMode: alwaysoverwrite; Flags: sharedfile Source: "pspell-15.dll"; DestDir: "{app}\bin"; CopyMode: alwaysoverwrite; Flags: sharedfile Source: "word-list-compress.exe"; DestDir: "{app}\bin"; CopyMode: alwaysoverwrite ; data files Source: "..\data\*.dat"; DestDir: "{app}\data"; CopyMode: alwaysoverwrite Source: "..\data\*.kbd"; DestDir: "{app}\data"; CopyMode: alwaysoverwrite ; documentation Source: "Readme-win32.txt"; DestDir: "{app}\doc"; CopyMode: alwaysoverwrite; Source: "..\..\aspell-0-50-3\README"; DestDir: "{app}"; CopyMode: alwaysoverwrite Source: "..\..\aspell-0-50-3\COPYING"; DestDir: "{app}"; CopyMode: alwaysoverwrite ; documentation Source: "..\..\aspell-0-50-3\manual\man-text\*.txt"; DestDir: "{app}\doc\text"; CopyMode: alwaysoverwrite Source: "..\..\aspell-0-50-3\manual\man-html\*.html"; DestDir: "{app}\doc\html"; CopyMode: alwaysoverwrite Source: "..\..\aspell-0-50-3\manual\man-html\*.css"; DestDir: "{app}\doc\html"; CopyMode: alwaysoverwrite Source: "..\..\aspell-0-50-3\manual\man-html\*.png"; DestDir: "{app}\doc\html"; CopyMode: alwaysoverwrite Source: "..\..\aspell-0-50-3\manual\man-html\manual.html"; DestDir: "{app}\doc\html"; CopyMode: alwaysoverwrite; Flags: isreadme [Registry] Root: HKLM; Subkey: "Software\Aspell"; ValueType: string; ValueName: ""; ValueData: {app}; Flags: uninsdeletekey Root: HKLM; Subkey: "Software\Aspell"; ValueType: string; ValueName: "Path"; ValueData: "{app}\bin"; Flags: uninsdeletekey Root: HKLM; Subkey: "Software\Aspell"; ValueType: string; ValueName: "UninstallString"; ValueData: {uninstallexe}; Flags: uninsdeletekey ; Aspell version Root: HKLM; Subkey: "Software\Aspell"; ValueType: dword; ValueName: "MajorVersion"; ValueData: "0"; Flags: uninsdeletekey Root: HKLM; Subkey: "Software\Aspell"; ValueType: dword; ValueName: "MinorVersion"; ValueData: "50"; Flags: uninsdeletekey Root: HKLM; Subkey: "Software\Aspell"; ValueType: dword; ValueName: "MicroVersion"; ValueData: "3"; Flags: uninsdeletekey ; library versions Root: HKLM; Subkey: "Software\Aspell"; ValueType: dword; ValueName: "AspellVersion"; ValueData: "15"; Flags: uninsdeletekey Root: HKLM; Subkey: "Software\Aspell"; ValueType: dword; ValueName: "PspellVersion"; ValueData: "15"; Flags: uninsdeletekey [INI] ; create internet shortcuts Filename: "{app}\doc\Aspell.url"; Section: "InternetShortcut"; Key: "URL"; String: "http://aspell.net" Filename: "{app}\doc\Aspell-win32.url"; Section: "InternetShortcut"; Key: "URL"; String: "http://aspell.net/win32" Filename: "{app}\doc\Aspell-support.url"; Section: "InternetShortcut"; Key: "URL"; String: "http://mail.gnu.org/mailman/listinfo/aspell-user" Filename: "{app}\doc\Aspell-dictionaries.url"; Section: "InternetShortcut"; Key: "URL"; String: "http://aspell.net/win32/dicts" [Icons] ; icons in startmenu, etc. Name: "{group}\Aspell homepage\Aspell home"; Filename: "{app}\doc\Aspell.url" Name: "{group}\Aspell homepage\Aspell (Win32)"; Filename: "{app}\doc\Aspell-win32.url" Name: "{group}\Aspell homepage\Aspell support"; Filename: "{app}\doc\Aspell-support.url" Name: "{group}\Aspell Manual"; Filename: "{app}\doc\html\manual.html" Name: "{group}\Download dictionaries"; Filename: "{app}\doc\Aspell-dictionaries.url" Name: "{group}\Uninstall Aspell-0.50-3"; Filename: "{uninstallexe}" Name: "{userdesktop}\Aspell (drop files here)"; Filename: "{app}\bin\Aspell.exe"; Parameters: "check"; Tasks: desktopicon Name: "{sendto}\Aspell"; Filename: "{app}\bin\Aspell.exe"; Parameters: "check"; MinVersion: 4,4; Tasks: sendtoicon [UninstallDelete] ; remove internet shortcuts Type: files; Name: "{app}\doc\Aspell.url" Type: files; Name: "{app}\doc\Aspell-win32.url" Type: files; Name: "{app}\doc\Aspell-support.url" Type: files; Name: "{app}\doc\Aspell-dictionaries.url" ; try to remove dirs if empty Type: dirifempty; Name: "{app}\doc\html"; Type: dirifempty; Name: "{app}\doc\text"; Type: dirifempty; Name: "{app}\doc"; Type: dirifempty; Name: "{app}\dict"; Type: dirifempty; Name: "{app}\data"; Type: dirifempty; Name: "{app}"; [Code] function AspellInstalled(var version,uninstallcmd:string):boolean; var maj,min,mic:Cardinal; begin Result := RegQueryDWordValue(HKLM, 'Software\Aspell', 'MajorVersion', maj) and RegQueryDWordValue(HKLM, 'Software\Aspell', 'MinorVersion', min) and RegQueryDWordValue(HKLM, 'Software\Aspell', 'MicroVersion', mic); if not RegQueryStringValue(HKLM, 'Software\Aspell', 'UninstallString', uninstallcmd) then if not RegQueryStringValue(HKLM, 'Software\Aspell', 'Uninstall', uninstallcmd) then RegQueryStringValue(HKLM, 'Software\Microsoft\Windows\CurrentVersion\Uninstall\Aspell', 'UninstallString', uninstallcmd); version:=IntToStr(maj)+'.'+IntToStr(min)+'-'+IntToStr(mic); end; function InitializeSetup(): Boolean; var version, uninst :string; msgres, execres :integer; begin Result:=true; if AspellInstalled(version,uninst) then begin msgres:=MsgBox('Aspell-'+version+' is currently installed.'+#13#13 +'Do you want to uninstall it first?.', mbError, MB_YESNOCANCEL); case msgres of IdYes: begin InstExec(uninst, '', '', true, true, SW_SHOWNORMAL, execres); Result:=InitializeSetup(); end; IdCancel: Result:=false; IdNo: ; end; end; end;