How to: Authoring a 64-bit ClickOnce Bootstrapper package in Visual Studio 2008 SP1


 


Before going into further details first “Disclaimer: This is just to help and does not guaranty that this is approved my employer or me J


 


Location of SQL Compact Bootstrapper


        <BootstrapperDir>\Packages\SQL Server Compact Edition\<LocaleCultureDir>\


Where,


·         <BootstrapperDir>  can be found by reading [HKLM\Software\Microsoft\GenericBootstrapper\3.5]path value otherwise its default value is %ProgramFiles%\Microsoft SDKs\Windows\v6.0A\Bootstrapper\ .


·         <LocaleCultureDir> is culture specific dir, ex: EN, DE, zh-CHS, zh-CHT, …


 


 


Follow the below steps, If you have an ‘Any CPU’ ClickOnce application using SQL Compact 3.5 SP1, for which you want to install SQL Compact x64 MSI on 64-bit machine.


Note: It is required to install both x86 and x64 MSIs on 64-bit OS, since x86 MSI is pre-requirement for x64 MSI.


 


Steps:


1)      Download the SQL Compact 3.5 SP1 x64 MSI and place it under <BootstrapperDir>\Packages\SQL Server Compact Edition\<LocaleCultureDir>\


 


2)      ClickOnce setup.exe is always runs as WoW process on x64 OS, that’s why reading a registry key is not useful for x64 MSI. We can achieve the install check using  <MsiProductCheck> element.


 


Edit the <BootstrapperDir>\Packages\SQL Server Compact Edition\<LocaleCultureDir>\Package.xml file with following details


·         As part  of <InstallChecks> element add <MsiProductCheck> as below


<InstallChecks>


    —


  <MsiProductCheck Property=”SQLCompactRunTimex64Installed Product=”[ProductCode]” />


    —


</InstallChecks>


 


[ProductCode] is the Product Code/GUID of the x64 MSI. Depending on locale, get it from below table for 3.5 SP1 x64 release.


You can use Orca.exe to get the ProductCode property of a MSI.


 





















































Locale


Three letter locale Id


Product Code


Chinese


CHS


{8DD60183-76ED-4416-8C9C-E5A39E1826EF}


Chinese (Taiwan)


CHT


{A423B3FB-C9E6-4953-9A83-2A5F45CAF466}


German


DEU


{77CB2F9F-67C5-4ADA-9321-B30C9C64727E}


English


ENU


{F83779DF-E1F5-43A2-A7BE-732F856FADB7}


Spanish


ESN


{5B32AC72-6251-47F4-BD1B-AD479E3EEBA9}


French


FRA


{A64CF374-A3DA-4B1E-A42A-6394C48F431A}


Italian


ITA


{4634B103-984E-4F31-BD80-DCD83AEEEF85}


Japanese


JPN


{1A22CAF6-E6FD-4D65-AEBA-F28D23B68EBF}


Korean


KOR


{38514244-6C25-42EC-B144-276F6DDAC9CE}


Portuguese (Brazil)


PTB


{C8445DBB-783F-4804-B373-D5CDC0614E60}


Russian


RUS


{CAA59A81-E35A-4582-80FF-F19520FFF60F}


 


3)      Add <PackageFile> element for x64 MSI. Replace [ThreeLetterLocaleID] with three letter locale id mentioned in above table.


 


<PackageFiles>


    —


<PackageFile Name=”SSCERuntime-[ThreeLetterLocaleID]-x64.msi    PublicKey=”3082010a0282010100a2db0a8dcfc2c1499bcdaa3a34ad23596bdb6cbe2122b794c8eaaebfc6d526c232118bbcda5d2cfb36561e152bae8f0ddd14a36e284c7f163f41ac8d40b146880dd98194ad9706d05744765ceaf1fc0ee27f74a333cb74e5efe361a17e03b745ffd53e12d5b0ca5e0dd07bf2b7130dfc606a2885758cb7adbc85e817b490bef516b6625ded11df3aee215b8baf8073c345e3958977609be7ad77c1378d33142f13db62c9ae1aa94f9867add420393071e08d6746e2c61cf40d5074412fe805246a216b49b092c4b239c742a56d5c184aab8fd78e833e780a47d8a4b28423c3e2f27b66b14a74bd26414b9c6114604e30c882f3d00b707cee554d77d2085576810203010001” />


</PackageFiles>


 


4)      Add <Command> elements for x64 MSI.


 


     </Commands>


            <!–  Install case for the x64 redist   –>


       <Command PackageFile=”SSCERuntime-[ThreeLetterLocaleID]-x64.msi Arguments=””>


<InstallConditions>


            <!–  ByPass if we have installed the x64 redist   –>


  <BypassIf Property=”SQLCompactRunTimex64Installed Compare=”ValueGreaterThan Value=”0” />


            <!–  Install only on AMD64 Processor   –>


  <BypassIf Property=”ProcessorArchitecture Compare=”ValueNotEqualTo Value=”AMD64” />


            <FailIf Property=”AdminUser Compare=”ValueEqualTo Value=”false String=”AdminRequired” />


  </InstallConditions>


   <ExitCodes>


  <ExitCode Value=”0 Result=”Success” />


  <ExitCode Value=”1641 Result=”SuccessReboot” />


  <ExitCode Value=”3010 Result=”SuccessReboot” />


  <ExitCode Value=”4123 Result=”SuccessReboot” />


  <DefaultExitCode Result=”Fail String=”Anunexpected FormatMessageFromSystem=”true” />


</ExitCodes>


       </Command>


 


            <!–  Reinstall/Repair case for the x64 redist   –>


       <Command PackageFile=”SSCERuntime-[ThreeLetterLocaleID]-x64.msi Arguments=”REINSTALL=ALL“>


<InstallConditions>


            <!–  Check if we haven’t  installed the x64 redist, no need to repair it   –>


  <InstallIf Property=”SQLCompactRunTimex64Installed Compare=”ValueGreaterThan Value=”0” />


            <!–  Install only on AMD64 Processor   –>


  <BypassIf Property=”ProcessorArchitecture Compare=”ValueNotEqualTo Value=”AMD64” />


            <!–  This is the actual condition for reinstalling the x64 MSI  –>


  <BypassIf Property=”ENU_INST_GAC Compare=”ValueExists” />


  <FailIf Property=”AdminUser Compare=”ValueEqualTo Value=”false String=”AdminRequired” />


</InstallConditions>


<ExitCodes>


  <ExitCode Value=”0 Result=”Success” />


  <ExitCode Value=”1641 Result=”SuccessReboot” />


  <ExitCode Value=”3010 Result=”SuccessReboot” />


  <ExitCode Value=”4123 Result=”SuccessReboot” />


  <DefaultExitCode Result=”Fail String=”Anunexpected FormatMessageFromSystem=”true” />


</ExitCodes>


       </Command>


      </Commands>


5      


          5) For making AnyCPU SQL Compact 3.5 SP1 Clickonce app to download 64-bit and 32-bit MSIs from microsoft download site (In this case, you can skip step 1), you need to do following additial things.


              a) Add HomeSite attribute to the 64-bit <PackageFile> element. 


<PackageFiles>


    —


<PackageFile Name=”SSCERuntime-[ThreeLetterLocaleID]-x64.msi 


  HomeSite=HomeSiteName_64   


  PublicKey=”3082010a0282010100a2db0a8dcfc2c1499bcdaa3a34ad23596bdb6cbe2122b794c8eaaebfc6d526c232118bbcda5d2cfb36561e152bae8f0ddd14a36e284c7f163f41ac8d40b146880dd98194ad9706d05744765ceaf1fc0ee27f74a333cb74e5efe361a17e03b745ffd53e12d5b0ca5e0dd07bf2b7130dfc606a2885758cb7adbc85e817b490bef516b6625ded11df3aee215b8baf8073c345e3958977609be7ad77c1378d33142f13db62c9ae1aa94f9867add420393071e08d6746e2c61cf40d5074412fe805246a216b49b092c4b239c742a56d5c184aab8fd78e833e780a47d8a4b28423c3e2f27b66b14a74bd26414b9c6114604e30c882f3d00b707cee554d77d2085576810203010001” />


</PackageFiles>


b) Add <String> for HomeSiteName_64 in <Strings>


 <Strings>


       —


      <String Name=HomeSiteName_64>[x64MSIDownloadURL]</String>


       —


 </Strings>


 


           In place of [x64MSIDownloadURL] put download URL for locale specific x64 Runtime MSI.


           Below is the list of locale specific download URLs for x64 3.5 SP1 Runtime MSIs. 





English: http://download.microsoft.com/download/8/4/2/8423C019-CCB4-4D7D-B7F0-BCF83F1B9218/SSCERuntime-ENU-x64.msi


German: http://download.microsoft.com/download/1/5/1/1517BA39-EAC3-4281-900B-AFB77369169A/SSCERuntime-DEU-x64.msi


Spanish: http://download.microsoft.com/download/C/B/E/CBE7CA6E-0D13-4186-A3CD-03C74CE9A0FA/SSCERuntime-ESN-x64.msi


French: http://download.microsoft.com/download/3/A/3/3A3B694E-9742-4AFF-8357-DCC9BAAE8A40/SSCERuntime-FRA-x64.msi


Italian: http://download.microsoft.com/download/9/E/F/9EF6D714-80EA-4373-962C-60436ED8A1D8/SSCERuntime-ITA-x64.msi


Japanese: http://download.microsoft.com/download/D/7/1/D717C79C-D847-42BF-BB9C-C1C390D203C4/SSCERuntime-JPN-x64.msi


Korean: http://download.microsoft.com/download/B/5/7/B5773FB4-1593-4746-824D-15235D820EFC/SSCERuntime-KOR-x64.msi


Portuguese (Brazil): http://download.microsoft.com/download/D/3/8/D388E5C0-8671-4F6A-8A05-86B9470B4E97/SSCERuntime-PTB-x64.msi


Russian: http://download.microsoft.com/download/2/3/E/23EB9CB1-F037-463F-BE83-AD3848FD1480/SSCERuntime-RUS-x64.msi


Chinese: http://download.microsoft.com/download/9/A/0/9A04CFE5-29CB-4B5C-A5F9-C66CB5FD1A9B/SSCERuntime-CHS-x64.msi


Chinese (Taiwan): http://download.microsoft.com/download/D/E/B/DEB711BD-FE6A-45E9-AA15-D9901E8458C3/SSCERuntime-CHT-x64.msi


 


 


 


ClickOnce Reference: http://msdn.microsoft.com/en-us/library/ms229223(VS.80).aspx


 


 


Thanks


Manikyam Bavandla