System.Data.SQLite
Check-in [9a42ab969b]
Not logged in

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Use built-in GAC handling provided by InnoSetup. Include and install Visual C++ runtime.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 9a42ab969b7e938ab09a649a3af3c07c575b94af
User & Date: mistachkin 2011-04-08 08:17:57
Context
2011-04-08
08:35
Disable prompt to remove GAC'd assembly on uninstall. Also, due to GAC and 'shared file' requirements, install assembly file to be GAC'd in its own directory. check-in: 3b8648f3d3 user: mistachkin tags: trunk
08:17
Use built-in GAC handling provided by InnoSetup. Include and install Visual C++ runtime. check-in: 9a42ab969b user: mistachkin tags: trunk
05:14
Add post-build step to copy interop dll to test directory (VS 2008). Also, add trailing backslash to VS 2010 post-build commands. check-in: a512f4ae40 user: mistachkin tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Added Externals/MSVCPP/vcredist_x64_2008_SP1.exe.

cannot compute difference between binary files

Added Externals/MSVCPP/vcredist_x64_2010_SP1.exe.

cannot compute difference between binary files

Added Externals/MSVCPP/vcredist_x86_2008_SP1.exe.

cannot compute difference between binary files

Added Externals/MSVCPP/vcredist_x86_2010_SP1.exe.

cannot compute difference between binary files

Changes to Setup/SQLite.iss.

     1      1   [Setup]
     2      2   AllowNoIcons=yes
            3  +ArchitecturesInstallIn64BitMode=x64
     3      4   AlwaysShowComponentsList=no
     4      5   AppCopyright=Public Domain
     5      6   AppID={{02E43EC2-6B1C-45B5-9E48-941C3E1B204A}
     6      7   AppName=System.Data.SQLite
     7      8   AppPublisher=System.Data.SQLite Team
     8      9   AppPublisherURL=http://system.data.sqlite.org/
     9     10   AppSupportURL=http://system.data.sqlite.org/
................................................................................
    30     31     NetFxSetupSubKeyName: String;
    31     32     NetFxIsInstalled: String;
    32     33   
    33     34     NetFx2Version: String;
    34     35     NetFx2SetupVersion: String;
    35     36     NetFx2HasServicePack: String;
    36     37     NetFx2ServicePack: Cardinal;
    37         -  NetFx2SdkSubKeyName: String;
    38         -  NetFx2SdkInstallRoot: String;
    39     38     NetFx2ErrorMessage: String;
    40     39   
    41     40     NetFx4Version: String;
    42     41     NetFx4SetupVersion: String;
    43     42     NetFx4HasServicePack: String;
    44     43     NetFx4ServicePack: Cardinal;
    45         -  NetFx4SdkSubKeyName: String;
    46         -  NetFx4SdkInstallRoot: String;
    47     44     NetFx4ErrorMessage: String;
    48     45   
    49     46   function CheckForNetFx2(NeedServicePack: Cardinal): Boolean;
    50     47   var
    51     48     SubKeyName: String;
    52     49     IsInstalled: Cardinal;
    53     50     HasServicePack: Cardinal;
................................................................................
   132    129       if FileName <> '' then
   133    130       begin
   134    131         Result := Result + '\' + FileName;
   135    132       end;
   136    133     end;
   137    134   end;
   138    135   
   139         -function GetNetFx2SdkInstallRoot(FileName: String): String;
   140         -var
   141         -  InstallRoot: String;
   142         -begin
   143         -  Result := '';
   144         -
   145         -  if RegQueryStringValue(HKEY_LOCAL_MACHINE, NetFx2SdkSubKeyName,
   146         -      NetFx2SdkInstallRoot, InstallRoot) then
   147         -  begin
   148         -    Result := InstallRoot;
   149         -
   150         -    if FileName <> '' then
   151         -    begin
   152         -      Result := Result + '\' + FileName;
   153         -    end;
   154         -  end;
   155         -end;
   156         -
   157         -function GetNetFx4SdkInstallRoot(FileName: String): String;
   158         -var
   159         -  InstallRoot: String;
   160         -begin
   161         -  Result := '';
   162         -
   163         -  if RegQueryStringValue(HKEY_LOCAL_MACHINE, NetFx4SdkSubKeyName,
   164         -      NetFx4SdkInstallRoot, InstallRoot) then
   165         -  begin
   166         -    Result := InstallRoot;
   167         -
   168         -    if FileName <> '' then
   169         -    begin
   170         -      Result := Result + '\' + FileName;
   171         -    end;
   172         -  end;
   173         -end;
   174         -
   175    136   function CheckIsNetFx2Setup(): Boolean;
   176    137   begin
   177    138     Result := IsNetFx2Setup;
   178    139   end;
   179    140   
   180    141   function CheckIsNetFx4Setup(): Boolean;
   181    142   begin
   182    143     Result := IsNetFx4Setup;
   183    144   end;
          145  +
          146  +function ExtractAndInstallVcRuntime(var ResultCode: Integer): Boolean;
          147  +begin
          148  +  ExtractTemporaryFile('vcredist_x86_2008_SP1.exe');
          149  +
          150  +  if Exec(ExpandConstant('{tmp}\vcredist_x86_2008_SP1.exe'), '/q', '',
          151  +      SW_SHOW, ewWaitUntilTerminated, ResultCode) then
          152  +  begin
          153  +    Result := True;
          154  +  end
          155  +  else begin
          156  +    Result := False;
          157  +  end;
          158  +end;
   184    159   
   185    160   function InitializeSetup(): Boolean;
          161  +var
          162  +  ResultCode: Integer;
   186    163   begin
   187    164     IsNetFx2Setup := True;
   188    165     IsNetFx4Setup := not IsNetFx2Setup;
   189    166   
   190    167     NetFxSubKeyName := 'Software\Microsoft\.NETFramework';
   191    168     NetFxInstallRoot := 'InstallRoot';
   192    169     NetFxSetupSubKeyName := 'Software\Microsoft\NET Framework Setup\NDP';
   193    170     NetFxIsInstalled := 'Install';
   194    171   
   195    172     NetFx2Version := 'v2.0.50727';
   196    173     NetFx2SetupVersion := 'v2.0.50727';
   197    174     NetFx2HasServicePack := 'SP';
   198    175     NetFx2ServicePack := 2;
   199         -  NetFx2SdkSubKeyName := NetFxSubKeyName
   200         -  NetFx2SdkInstallRoot := 'sdkInstallRootv2.0';
   201    176     NetFx2ErrorMessage := 'The Microsoft .NET Framework v2.0 with Service Pack '
   202    177         + IntToStr(NetFx2ServicePack) + ' or higher is required.';
   203    178   
   204    179     NetFx4Version := 'v4.0.30319';
   205    180     NetFx4SetupVersion := 'v4\Full';
   206    181     NetFx4HasServicePack := 'Servicing';
   207    182     NetFx4ServicePack := 0;
   208         -  NetFx4SdkSubKeyName :=
   209         -      'Software\Microsoft\Microsoft SDKs\Windows\v7.0A\WinSDK-NetFx40Tools';
   210         -
   211         -  NetFx4SdkInstallRoot := 'InstallationFolder';
   212    183     NetFx4ErrorMessage := 'The Microsoft .NET Framework v4.0 with Service Pack '
   213    184         + IntToStr(NetFx4ServicePack) + ' or higher is required.';
   214    185   
   215    186     if IsNetFx2Setup then
   216    187     begin
   217    188       Result := CheckForNetFx2(NetFx2ServicePack);
   218    189   
................................................................................
   227    198       Result := CheckForNetFx4(NetFx4ServicePack);
   228    199   
   229    200       if not Result then
   230    201       begin
   231    202         MsgBox(NetFx4ErrorMessage, mbError, MB_OK);
   232    203       end;
   233    204     end;
          205  +
          206  +  if Result then
          207  +  begin
          208  +    Result := ExtractAndInstallVcRuntime(ResultCode);
          209  +
          210  +    if not Result then
          211  +    begin
          212  +      MsgBox('Failed to install Microsoft Visual C++ Runtime: ' +
          213  +          SysErrorMessage(ResultCode), mbError, MB_OK);
          214  +    end;
          215  +  end;
   234    216   end;
   235    217   
   236    218   [Components]
   237    219   Name: Application; Description: System.Data.SQLite components.; Types: custom compact full
   238    220   Name: Application\Core; Description: Core components.; Types: custom compact full
   239    221   Name: Application\Core\MSIL; Description: Core managed components.; Types: custom compact full
   240    222   Name: Application\Core\x86; Description: Core native components.; Types: custom compact full
................................................................................
   243    225   Name: Application\Test; Description: Test components.; Types: custom compact full
   244    226   
   245    227   [Tasks]
   246    228   Components: Application\Core\MSIL; Name: GAC; Description: Install the assemblies into the global assembly cache.; Flags: unchecked; Check: CheckIsNetFx2Setup() or CheckIsNetFx4Setup()
   247    229   Components: Application\Core\MSIL; Name: NGEN; Description: Generate native images for the assemblies and install the images in the native image cache.; Check: CheckIsNetFx2Setup() or CheckIsNetFx4Setup()
   248    230   
   249    231   [Run]
   250         -Components: Application\Core\MSIL; Tasks: GAC; Filename: {code:GetNetFx2SdkInstallRoot|bin\Gacutil.exe}; Parameters: "/nologo /if ""{app}\bin\System.Data.SQLite.dll"""; Flags: skipifdoesntexist; Check: CheckIsNetFx2Setup()
   251    232   Components: Application\Core\MSIL; Tasks: NGEN; Filename: {code:GetNetFx2InstallRoot|Ngen.exe}; Parameters: "install ""{app}\bin\System.Data.SQLite.dll"" /nologo"; Flags: skipifdoesntexist; Check: CheckIsNetFx2Setup()
   252         -Components: Application\Core\MSIL; Tasks: GAC; Filename: {code:GetNetFx4SdkInstallRoot|Gacutil.exe}; Parameters: "/nologo /if ""{app}\bin\System.Data.SQLite.dll"""; Flags: skipifdoesntexist; Check: CheckIsNetFx4Setup()
   253    233   Components: Application\Core\MSIL; Tasks: NGEN; Filename: {code:GetNetFx4InstallRoot|Ngen.exe}; Parameters: "install ""{app}\bin\System.Data.SQLite.dll"" /nologo"; Flags: skipifdoesntexist; Check: CheckIsNetFx4Setup()
   254    234   
   255    235   [UninstallRun]
   256    236   Components: Application\Core\MSIL; Tasks: NGEN; Filename: {code:GetNetFx4InstallRoot|Ngen.exe}; Parameters: "uninstall ""{app}\bin\System.Data.SQLite.dll"" /nologo"; Flags: skipifdoesntexist; Check: CheckIsNetFx4Setup()
   257         -Components: Application\Core\MSIL; Tasks: GAC; Filename: {code:GetNetFx4SdkInstallRoot|Gacutil.exe}; Parameters: "/nologo /uf System.Data.SQLite"; Flags: skipifdoesntexist; Check: CheckIsNetFx4Setup()
   258    237   Components: Application\Core\MSIL; Tasks: NGEN; Filename: {code:GetNetFx2InstallRoot|Ngen.exe}; Parameters: "uninstall ""{app}\bin\System.Data.SQLite.dll"" /nologo"; Flags: skipifdoesntexist; Check: CheckIsNetFx2Setup()
   259         -Components: Application\Core\MSIL; Tasks: GAC; Filename: {code:GetNetFx2SdkInstallRoot|bin\Gacutil.exe}; Parameters: "/nologo /uf System.Data.SQLite"; Flags: skipifdoesntexist; Check: CheckIsNetFx2Setup()
   260    238   
   261    239   [Dirs]
   262    240   Name: {app}\bin
   263    241   Name: {app}\doc
   264    242   
   265    243   [Files]
   266         -Components: Application; Source: ..\readme.htm; DestDir: {app}; Flags: restartreplace uninsrestartdelete
          244  +Components: Application\Core\x86; Source: ..\Externals\MSVCPP\vcredist_x86_2008_SP1.exe; DestDir: {tmp}; Flags: dontcopy
          245  +Components: Application; Source: ..\readme.htm; DestDir: {app}; Flags: restartreplace uninsrestartdelete isreadme
          246  +Components: Application\Core\MSIL; Tasks: GAC; Source: ..\bin\Release\bin\System.Data.SQLite.dll; DestDir: {app}; StrongAssemblyName: "System.Data.SQLite, Version=1.0.67.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139, ProcessorArchitecture=MSIL"; Flags: restartreplace uninsrestartdelete sharedfile gacinstall
   267    247   Components: Application\Core\MSIL; Source: ..\bin\Release\bin\System.Data.SQLite.dll; DestDir: {app}\bin; Flags: restartreplace uninsrestartdelete
   268    248   Components: Application\Core\MSIL and Application\Symbols; Source: ..\bin\Release\bin\System.Data.SQLite.pdb; DestDir: {app}\bin; Flags: restartreplace uninsrestartdelete
   269    249   Components: Application\Core\x86; Source: ..\bin\Win32\ReleaseNativeOnly\SQLite.Interop.dll; DestDir: {app}\bin; Flags: restartreplace uninsrestartdelete
   270    250   Components: Application\Core\x86 and Application\Symbols; Source: ..\bin\Win32\ReleaseNativeOnly\SQLite.Interop.pdb; DestDir: {app}\bin; Flags: restartreplace uninsrestartdelete
   271    251   Components: Application\Documentation; Source: ..\doc\SQLite.NET.chm; DestDir: {app}\doc; Flags: restartreplace uninsrestartdelete
   272    252   Components: Application\Test; Source: ..\bin\Release\bin\test.exe; DestDir: {app}\bin; Flags: restartreplace uninsrestartdelete
   273    253   Components: Application\Test and Application\Symbols; Source: ..\bin\Release\bin\test.pdb; DestDir: {app}\bin; Flags: restartreplace uninsrestartdelete
   274    254   Components: Application\Test; Source: ..\bin\Release\bin\test.exe.config; DestDir: {app}\bin; Flags: restartreplace uninsrestartdelete
   275    255   
   276    256   [Icons]
   277    257   Name: {group}\Test Suite; Filename: {app}\bin\test.exe; WorkingDir: {app}\bin; IconFilename: {app}\bin\test.exe; Comment: Launch Test Suite; IconIndex: 0; Flags: createonlyiffileexists
   278    258   Name: {group}\Class Library Documentation; Filename: {app}\doc\SQLite.NET.chm; WorkingDir: {app}\doc; Comment: Launch Class Library Documentation; Flags: createonlyiffileexists
   279    259   Name: {group}\README File; Filename: {app}\readme.htm; WorkingDir: {app}; Comment: View README File; Flags: createonlyiffileexists