Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | Setup changes to optionally add install directory to path if GACing. |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
172f53bd6f0b3a3bb6a827ceb05cf641 |
User & Date: | shaneh 2011-04-27 17:40:56 |
Context
2011-04-27
| ||
17:53 | Update to [7b479b9bee] of SQLite trunk. check-in: 4d8a17203d user: shaneh tags: trunk | |
17:40 | Setup changes to optionally add install directory to path if GACing. check-in: 172f53bd6f user: shaneh tags: trunk | |
17:40 | Line ending changes. check-in: 354f178d33 user: shaneh tags: trunk | |
Changes
Changes to Setup/SQLite.iss.
1 1 ; 2 2 ; SQLite.iss -- 3 3 ; 4 4 ; Written by Joe Mistachkin. 5 5 ; Released to the public domain, use at your own risk! 6 6 ; 7 +; 8 +; modpath (c)2010 by Jared Breland, and licensed under the Creative Commons Attribution-ShareAlike 3.0 9 +; 7 10 8 11 [Setup] 9 12 AllowNoIcons=true 10 13 ArchitecturesInstallIn64BitMode=x64 11 14 AlwaysShowComponentsList=false 12 15 AppCopyright=Public Domain 13 16 AppID={#AppId} ................................................................................ 18 21 AppUpdatesURL={#AppURL} 19 22 AppVerName=System.Data.SQLite v{#AppVersion} 20 23 AppVersion={#AppVersion} 21 24 AppComments=The ADO.NET adapter for the SQLite database engine. 22 25 AppReadmeFile={app}\readme.htm 23 26 DefaultDirName={pf}\System.Data.SQLite 24 27 DefaultGroupName=System.Data.SQLite 25 -OutputBaseFilename=sqlite-dotnet-{#AppProcessor}-{#Year}-{#AppVersion} 28 +OutputBaseFilename=sqlite-dotnet-{#AppProcessor}-{#AppVersion} 26 29 SetupLogging=true 27 30 UninstallFilesDir={app}\uninstall 28 31 VersionInfoVersion={#AppVersion} 29 32 ExtraDiskSpaceRequired=2097152 33 +ChangesEnvironment=true 30 34 31 35 [Code] 32 36 #include "CheckForNetFx.pas" 33 37 #include "InitializeSetup.pas" 38 +const 39 + ModPathName = 'gac\modifypath'; 40 + ModPathType = 'system'; 41 +function ModPathDir(): TArrayOfString; 42 +begin 43 + setArrayLength(Result, 1) 44 + Result[0] := ExpandConstant('{app}'); 45 +end; 46 +#include "modpath.iss" 34 47 35 48 [Components] 36 49 Name: Application; Description: System.Data.SQLite components.; Types: custom compact full 37 50 Name: Application\Core; Description: Core components.; Types: custom compact full 38 51 Name: Application\Core\MSIL; Description: Core managed components.; Types: custom compact full 39 52 Name: Application\Core\{#AppProcessor}; Description: Core native components.; Types: custom compact full 40 53 Name: Application\LINQ; Description: LINQ support components.; Types: custom compact full 41 54 Name: Application\Symbols; Description: Debugging symbol components.; Types: custom compact full 42 55 Name: Application\Documentation; Description: Documentation components.; Types: custom compact full 43 56 Name: Application\Test; Description: Test components.; Types: custom compact full 44 57 45 58 [Tasks] 46 -Components: Application\Core\MSIL Or Application\LINQ; Name: GAC; Description: Install the assemblies into the global assembly cache.; Flags: unchecked; Check: CheckIsNetFx2Setup() or CheckIsNetFx4Setup() 47 -Components: Application\Core\MSIL Or Application\LINQ; Name: NGEN; Description: Generate native images for the assemblies and install the images in the native image cache.; Check: CheckIsNetFx2Setup() or CheckIsNetFx4Setup() 59 +Components: Application\Core\MSIL Or Application\LINQ; Name: ngen; Description: Generate native images for the assemblies and install the images in the native image cache.; Check: CheckIsNetFx2Setup() or CheckIsNetFx4Setup() 60 +Components: Application\Core\MSIL Or Application\LINQ; Name: gac; Description: Install the assemblies into the global assembly cache.; Flags: unchecked; Check: CheckIsNetFx2Setup() or CheckIsNetFx4Setup() 61 +Components: Application\Core\MSIL Or Application\LINQ; Name: gac\modifypath; Description: &Add application directory to your environmental path; Flags: unchecked 48 62 49 63 [Run] 50 -Components: Application\Core\MSIL; Tasks: NGEN; Filename: {code:GetNetFx2InstallRoot|Ngen.exe}; Parameters: "install ""{app}\bin\System.Data.SQLite.dll"" /nologo"; Flags: skipifdoesntexist; Check: CheckIsNetFx2Setup() 51 -Components: Application\Core\MSIL; Tasks: NGEN; Filename: {code:GetNetFx4InstallRoot|Ngen.exe}; Parameters: "install ""{app}\bin\System.Data.SQLite.dll"" /nologo"; Flags: skipifdoesntexist; Check: CheckIsNetFx4Setup() 52 -Components: Application\LINQ; Tasks: NGEN; Filename: {code:GetNetFx2InstallRoot|Ngen.exe}; Parameters: "install ""{app}\bin\System.Data.SQLite.Linq.dll"" /nologo"; Flags: skipifdoesntexist; Check: CheckIsNetFx2Setup() and CheckForNetFx35(1) 53 -Components: Application\LINQ; Tasks: NGEN; Filename: {code:GetNetFx4InstallRoot|Ngen.exe}; Parameters: "install ""{app}\bin\System.Data.SQLite.Linq.dll"" /nologo"; Flags: skipifdoesntexist; Check: CheckIsNetFx4Setup() 64 +Components: Application\Core\MSIL; Tasks: ngen; Filename: {code:GetNetFx2InstallRoot|Ngen.exe}; Parameters: "install ""{app}\bin\System.Data.SQLite.dll"" /nologo"; Flags: skipifdoesntexist; Check: CheckIsNetFx2Setup() 65 +Components: Application\Core\MSIL; Tasks: ngen; Filename: {code:GetNetFx4InstallRoot|Ngen.exe}; Parameters: "install ""{app}\bin\System.Data.SQLite.dll"" /nologo"; Flags: skipifdoesntexist; Check: CheckIsNetFx4Setup() 66 +Components: Application\LINQ; Tasks: ngen; Filename: {code:GetNetFx2InstallRoot|Ngen.exe}; Parameters: "install ""{app}\bin\System.Data.SQLite.Linq.dll"" /nologo"; Flags: skipifdoesntexist; Check: CheckIsNetFx2Setup() and CheckForNetFx35(1) 67 +Components: Application\LINQ; Tasks: ngen; Filename: {code:GetNetFx4InstallRoot|Ngen.exe}; Parameters: "install ""{app}\bin\System.Data.SQLite.Linq.dll"" /nologo"; Flags: skipifdoesntexist; Check: CheckIsNetFx4Setup() 54 68 55 69 [UninstallRun] 56 -Components: Application\LINQ; Tasks: NGEN; Filename: {code:GetNetFx4InstallRoot|Ngen.exe}; Parameters: "uninstall ""{app}\bin\System.Data.SQLite.Linq.dll"" /nologo"; Flags: skipifdoesntexist; Check: CheckIsNetFx4Setup() 57 -Components: Application\LINQ; Tasks: NGEN; Filename: {code:GetNetFx2InstallRoot|Ngen.exe}; Parameters: "uninstall ""{app}\bin\System.Data.SQLite.Linq.dll"" /nologo"; Flags: skipifdoesntexist; Check: CheckIsNetFx2Setup() and CheckForNetFx35(1) 58 -Components: Application\Core\MSIL; Tasks: NGEN; Filename: {code:GetNetFx4InstallRoot|Ngen.exe}; Parameters: "uninstall ""{app}\bin\System.Data.SQLite.dll"" /nologo"; Flags: skipifdoesntexist; Check: CheckIsNetFx4Setup() 59 -Components: Application\Core\MSIL; Tasks: NGEN; Filename: {code:GetNetFx2InstallRoot|Ngen.exe}; Parameters: "uninstall ""{app}\bin\System.Data.SQLite.dll"" /nologo"; Flags: skipifdoesntexist; Check: CheckIsNetFx2Setup() 70 +Components: Application\LINQ; Tasks: ngen; Filename: {code:GetNetFx4InstallRoot|Ngen.exe}; Parameters: "uninstall ""{app}\bin\System.Data.SQLite.Linq.dll"" /nologo"; Flags: skipifdoesntexist; Check: CheckIsNetFx4Setup() 71 +Components: Application\LINQ; Tasks: ngen; Filename: {code:GetNetFx2InstallRoot|Ngen.exe}; Parameters: "uninstall ""{app}\bin\System.Data.SQLite.Linq.dll"" /nologo"; Flags: skipifdoesntexist; Check: CheckIsNetFx2Setup() and CheckForNetFx35(1) 72 +Components: Application\Core\MSIL; Tasks: ngen; Filename: {code:GetNetFx4InstallRoot|Ngen.exe}; Parameters: "uninstall ""{app}\bin\System.Data.SQLite.dll"" /nologo"; Flags: skipifdoesntexist; Check: CheckIsNetFx4Setup() 73 +Components: Application\Core\MSIL; Tasks: ngen; Filename: {code:GetNetFx2InstallRoot|Ngen.exe}; Parameters: "uninstall ""{app}\bin\System.Data.SQLite.dll"" /nologo"; Flags: skipifdoesntexist; Check: CheckIsNetFx2Setup() 60 74 61 75 [Dirs] 62 76 Name: {app}\bin 63 77 Name: {app}\doc 64 78 Name: {app}\GAC 65 79 66 80 [Files] 67 81 Components: Application\Core\{#AppProcessor}; Source: ..\Externals\MSVCPP\vcredist_{#AppProcessor}_{#VcRuntime}.exe; DestDir: {tmp}; Flags: dontcopy 68 82 Components: Application; Source: ..\readme.htm; DestDir: {app}; Flags: restartreplace uninsrestartdelete isreadme 69 -Components: Application\Core\MSIL; Tasks: GAC; Source: ..\bin\Release\bin\System.Data.SQLite.dll; DestDir: {app}\GAC; StrongAssemblyName: "System.Data.SQLite, Version={#AppVersion}, Culture=neutral, PublicKeyToken={#AppPublicKey}, ProcessorArchitecture=MSIL"; Flags: restartreplace uninsrestartdelete uninsnosharedfileprompt sharedfile gacinstall 83 +Components: Application\Core\MSIL; Tasks: gac; Source: ..\bin\Release\bin\System.Data.SQLite.dll; DestDir: {app}\GAC; StrongAssemblyName: "System.Data.SQLite, Version={#AppVersion}, Culture=neutral, PublicKeyToken={#AppPublicKey}, ProcessorArchitecture=MSIL"; Flags: restartreplace uninsrestartdelete uninsnosharedfileprompt sharedfile gacinstall 70 84 Components: Application\Core\MSIL; Source: ..\bin\Release\bin\System.Data.SQLite.dll; DestDir: {app}\bin; Flags: restartreplace uninsrestartdelete 71 85 Components: Application\Core\MSIL and Application\Symbols; Source: ..\bin\Release\bin\System.Data.SQLite.pdb; DestDir: {app}\bin; Flags: restartreplace uninsrestartdelete 72 -Components: Application\LINQ; Tasks: GAC; Source: ..\bin\Release\bin\System.Data.SQLite.Linq.dll; DestDir: {app}\GAC; StrongAssemblyName: "System.Data.SQLite.Linq, Version={#AppVersion}, Culture=neutral, PublicKeyToken={#AppPublicKey}, ProcessorArchitecture=MSIL"; Flags: restartreplace uninsrestartdelete uninsnosharedfileprompt sharedfile gacinstall 86 +Components: Application\LINQ; Tasks: gac; Source: ..\bin\Release\bin\System.Data.SQLite.Linq.dll; DestDir: {app}\GAC; StrongAssemblyName: "System.Data.SQLite.Linq, Version={#AppVersion}, Culture=neutral, PublicKeyToken={#AppPublicKey}, ProcessorArchitecture=MSIL"; Flags: restartreplace uninsrestartdelete uninsnosharedfileprompt sharedfile gacinstall 73 87 Components: Application\LINQ; Source: ..\bin\Release\bin\System.Data.SQLite.Linq.dll; DestDir: {app}\bin; Flags: restartreplace uninsrestartdelete 74 88 Components: Application\LINQ and Application\Symbols; Source: ..\bin\Release\bin\System.Data.SQLite.Linq.pdb; DestDir: {app}\bin; Flags: restartreplace uninsrestartdelete 75 89 Components: Application\Core\{#AppProcessor}; Source: ..\bin\{#AppPlatform}\ReleaseNativeOnly\SQLite.Interop.dll; DestDir: {app}\bin; Flags: restartreplace uninsrestartdelete 76 90 Components: Application\Core\{#AppProcessor} and Application\Symbols; Source: ..\bin\{#AppPlatform}\ReleaseNativeOnly\SQLite.Interop.pdb; DestDir: {app}\bin; Flags: restartreplace uninsrestartdelete 77 91 Components: Application\Documentation; Source: ..\doc\SQLite.NET.chm; DestDir: {app}\doc; Flags: restartreplace uninsrestartdelete 78 92 Components: Application\Test; Source: ..\bin\Release\bin\test.exe; DestDir: {app}\bin; Flags: restartreplace uninsrestartdelete 79 93 Components: Application\Test and Application\Symbols; Source: ..\bin\Release\bin\test.pdb; DestDir: {app}\bin; Flags: restartreplace uninsrestartdelete 80 94 Components: Application\Test; Source: ..\bin\Release\bin\test.exe.config; DestDir: {app}\bin; Flags: restartreplace uninsrestartdelete 81 95 82 96 [Icons] 83 97 Name: {group}\Test Application; Filename: {app}\bin\test.exe; WorkingDir: {app}\bin; IconFilename: {app}\bin\test.exe; Comment: Launch Test Application; IconIndex: 0; Flags: createonlyiffileexists 84 98 Name: {group}\Class Library Documentation; Filename: {app}\doc\SQLite.NET.chm; WorkingDir: {app}\doc; Comment: Launch Class Library Documentation; Flags: createonlyiffileexists 85 99 Name: {group}\README File; Filename: {app}\readme.htm; WorkingDir: {app}; Comment: View README File; Flags: createonlyiffileexists
Added Setup/modpath.iss.
1 +// ---------------------------------------------------------------------------- 2 +// 3 +// Inno Setup Ver: 5.3.10 4 +// Script Version: 1.4.0 5 +// Author: Jared Breland <jbreland@legroom.net> 6 +// Homepage: http://www.legroom.net/software 7 +// 8 +// Script Function: 9 +// Allow modification of environmental path directly from Inno Setup installers 10 +// 11 +// Instructions: 12 +// Copy modpath.iss to the same directory as your setup script 13 +// 14 +// Add this statement to your [Setup] section 15 +// ChangesEnvironment=true 16 +// 17 +// Add this statement to your [Tasks] section 18 +// You can change the Description or Flags 19 +// You can change the Name, but it must match the ModPathName setting below 20 +// Name: modifypath; Description: &Add application directory to your environmental path; Flags: unchecked 21 +// 22 +// Add the following to the end of your [Code] section 23 +// ModPathName defines the name of the task defined above 24 +// ModPathType defines whether the 'user' or 'system' path will be modified 25 +// this will default to user if anything other than user or system is set 26 +// setArrayLength must specify the total number of dirs to be added 27 +// Result[0] contains first directory, Result[1] contains second, etc. 28 +// const 29 +// ModPathName = 'modifypath'; 30 +// ModPathType = 'user'; 31 +// 32 +// function ModPathDir(): TArrayOfString; 33 +// begin 34 +// setArrayLength(Result, 1) 35 +// Result[0] := ExpandConstant('{app}'); 36 +// end; 37 +// #include "modpath.iss" 38 +// ---------------------------------------------------------------------------- 39 + 40 +procedure ModPath(); 41 +var 42 + oldpath: String; 43 + newpath: String; 44 + updatepath: Boolean; 45 + pathArr: TArrayOfString; 46 + aExecFile: String; 47 + aExecArr: TArrayOfString; 48 + i, d: Integer; 49 + pathdir: TArrayOfString; 50 + regroot: Integer; 51 + regpath: String; 52 + 53 +begin 54 + // Get constants from main script and adjust behavior accordingly 55 + // ModPathType MUST be 'system' or 'user'; force 'user' if invalid 56 + if ModPathType = 'system' then begin 57 + regroot := HKEY_LOCAL_MACHINE; 58 + regpath := 'SYSTEM\CurrentControlSet\Control\Session Manager\Environment'; 59 + end else begin 60 + regroot := HKEY_CURRENT_USER; 61 + regpath := 'Environment'; 62 + end; 63 + 64 + // Get array of new directories and act on each individually 65 + pathdir := ModPathDir(); 66 + for d := 0 to GetArrayLength(pathdir)-1 do begin 67 + updatepath := true; 68 + 69 + // Modify WinNT path 70 + if UsingWinNT() = true then begin 71 + 72 + // Get current path, split into an array 73 + RegQueryStringValue(regroot, regpath, 'Path', oldpath); 74 + oldpath := oldpath + ';'; 75 + i := 0; 76 + 77 + while (Pos(';', oldpath) > 0) do begin 78 + SetArrayLength(pathArr, i+1); 79 + pathArr[i] := Copy(oldpath, 0, Pos(';', oldpath)-1); 80 + oldpath := Copy(oldpath, Pos(';', oldpath)+1, Length(oldpath)); 81 + i := i + 1; 82 + 83 + // Check if current directory matches app dir 84 + if pathdir[d] = pathArr[i-1] then begin 85 + // if uninstalling, remove dir from path 86 + if IsUninstaller() = true then begin 87 + continue; 88 + // if installing, flag that dir already exists in path 89 + end else begin 90 + updatepath := false; 91 + end; 92 + end; 93 + 94 + // Add current directory to new path 95 + if i = 1 then begin 96 + newpath := pathArr[i-1]; 97 + end else begin 98 + newpath := newpath + ';' + pathArr[i-1]; 99 + end; 100 + end; 101 + 102 + // Append app dir to path if not already included 103 + if (IsUninstaller() = false) AND (updatepath = true) then 104 + newpath := newpath + ';' + pathdir[d]; 105 + 106 + // Write new path 107 + RegWriteStringValue(regroot, regpath, 'Path', newpath); 108 + 109 + // Modify Win9x path 110 + end else begin 111 + 112 + // Convert to shortened dirname 113 + pathdir[d] := GetShortName(pathdir[d]); 114 + 115 + // If autoexec.bat exists, check if app dir already exists in path 116 + aExecFile := 'C:\AUTOEXEC.BAT'; 117 + if FileExists(aExecFile) then begin 118 + LoadStringsFromFile(aExecFile, aExecArr); 119 + for i := 0 to GetArrayLength(aExecArr)-1 do begin 120 + if IsUninstaller() = false then begin 121 + // If app dir already exists while installing, skip add 122 + if (Pos(pathdir[d], aExecArr[i]) > 0) then 123 + updatepath := false; 124 + break; 125 + end else begin 126 + // If app dir exists and = what we originally set, then delete at uninstall 127 + if aExecArr[i] = 'SET PATH=%PATH%;' + pathdir[d] then 128 + aExecArr[i] := ''; 129 + end; 130 + end; 131 + end; 132 + 133 + // If app dir not found, or autoexec.bat didn't exist, then (create and) append to current path 134 + if (IsUninstaller() = false) AND (updatepath = true) then begin 135 + SaveStringToFile(aExecFile, #13#10 + 'SET PATH=%PATH%;' + pathdir[d], True); 136 + 137 + // If uninstalling, write the full autoexec out 138 + end else begin 139 + SaveStringsToFile(aExecFile, aExecArr, False); 140 + end; 141 + end; 142 + end; 143 + 144 + // Write file to flag modifypath was selected 145 + // Workaround since IsTaskSelected() cannot be called at uninstall and AppName and AppId cannot be "read" in Code section 146 + if IsUninstaller() = false then 147 + SaveStringToFile(ExpandConstant('{app}') + '\uninsTasks.txt', WizardSelectedTasks(False), False); 148 +end; 149 + 150 +procedure CurStepChanged(CurStep: TSetupStep); 151 +var 152 + taskname: String; 153 +begin 154 + taskname := ModPathName; 155 + if CurStep = ssPostInstall then 156 + if IsTaskSelected(taskname) then 157 + ModPath(); 158 +end; 159 + 160 +procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep); 161 +var 162 + appdir: String; 163 + aSelectedTasks: TArrayOfString; 164 + i: Integer; 165 + taskname: String; 166 +begin 167 + taskname := ModPathName; 168 + appdir := ExpandConstant('{app}') 169 + if CurUninstallStep = usUninstall then begin 170 + if LoadStringsFromFile(appdir + '\uninsTasks.txt', aSelectedTasks) then 171 + //for i := 0 to GetArrayLength(aSelectedTasks)-1 do 172 + //if aSelectedTasks[i] = taskname then 173 + ModPath(); 174 + DeleteFile(appdir + '\uninsTasks.txt'); 175 + end; 176 +end; 177 + 178 +function NeedRestart(): Boolean; 179 +var 180 + taskname: String; 181 +begin 182 + taskname := ModPathName; 183 + if IsTaskSelected(taskname) and not UsingWinNT() then begin 184 + Result := True; 185 + end else begin 186 + Result := False; 187 + end; 188 +end;