<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:pingback="http://madskills.com/public/xml/rss/module/pingback/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0">
  <channel>
    <title>Mike Francis: My Mobile Home - Setup</title>
    <link>http://blog.mjfnet.com/Blog/</link>
    <description>focusing on mobile application development...</description>
    <image>
      <url>http://www.mjfnet.com/blog/images/mikehead.jpg</url>
      <title>Mike Francis: My Mobile Home - Setup</title>
      <link>http://blog.mjfnet.com/Blog/</link>
    </image>
    <language>en-us</language>
    <copyright>Mike Francis</copyright>
    <lastBuildDate>Fri, 30 Apr 2010 20:51:03 GMT</lastBuildDate>
    <generator>newtelligence dasBlog 2.3.9074.18820</generator>
    <managingEditor>mike@mjfnet.com</managingEditor>
    <webMaster>mike@mjfnet.com</webMaster>
    <item>
      <trackback:ping>http://blog.mjfnet.com/Blog/Trackback.aspx?guid=7fa578ed-150d-4236-8183-cf5cb3b79a16</trackback:ping>
      <pingback:server>http://blog.mjfnet.com/Blog/pingback.aspx</pingback:server>
      <pingback:target>http://blog.mjfnet.com/Blog/PermaLink,guid,7fa578ed-150d-4236-8183-cf5cb3b79a16.aspx</pingback:target>
      <dc:creator>Mike Francis</dc:creator>
      <wfw:comment>http://blog.mjfnet.com/Blog/CommentView,guid,7fa578ed-150d-4236-8183-cf5cb3b79a16.aspx</wfw:comment>
      <wfw:commentRss>http://blog.mjfnet.com/Blog/SyndicationService.asmx/GetEntryCommentsRss?guid=7fa578ed-150d-4236-8183-cf5cb3b79a16</wfw:commentRss>
      <slash:comments>5</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
          <em>Update: I've updated the sample to be independent of the '\Program Files' string.
Also, the sample now supports installing onto a Storage Card. </em>
        </p>
        <p>
A popular sample for demonstrating how to install application dependencies via embedded
CAB files is <a href="http://msdn.microsoft.com/en-us/library/bb158796.aspx">MultiCAB
Install</a>. With this pattern you can distribute dependant cab files via a single
container CAB. “Can apps be distributed via <a href="http://developer.windowsphone.com">Windows
Marketplace for Mobile</a> using this?”,you ask. Yes they can.
</p>
        <p>
Installing SQL Server Compact dependencies is a good fit for this pattern. I have
updated the sample <a href="http://blog.mjfnet.com/files/multicabinstall.zip">here</a> customized
to distribute the <a href="http://www.microsoft.com/downloads/details.aspx?familyid=5544C638-C532-48E3-871C-58B49C5D855C&amp;displaylang=en">latest</a> SQL
Server Compact for Windows Mobile devices.
</p>
        <p>
The sample checks if SQL Server Compact 3.5 is installed (See IsSQLCEUpdateRequired()
in mcsetup.cpp) and if not, launches the multicab EXE which installs each dependant
cab in sequence. (See the multicab whitepaper included in the sample for an in-depth
explanation of how it works.) 
</p>
        <p>
How does the sample check to see if v3.5 is installed? It checks the registry for
the following entry:
</p>
        <div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:2e569270-d267-48bb-9474-3ecb7078dbe6" class="wlWriterEditableSmartContent">
          <div style="border: #000080 1px solid; color: #000; font-family: 'Courier New', Courier, Monospace; font-size: 10pt">
            <div style="background: #fff; max-height: 300px; overflow: auto">
              <ol style="background: #ffffff; margin: 0; padding: 0 0 0 5px; white-space: nowrap">
                <li>
\<span style="color:#a31515">Software\Microsoft\Microsoft SQL Server Compact
Edition\v3.5</span></li>
              </ol>
            </div>
          </div>
        </div>
        <p>
This this exists, then installation of the SQLCE cabs is skipped. Note that this registry
key only exists if SQLCE has been installed via a CAB file. That is, this registry
key does not exist of SQLCE is in ROM. As of this writing, 3.5 (SP1 or SP2) is not
distributed in ROM. See here for a list of OS and corresponding SQLCE versions: <a title="Description of the various build versions of SQL Server Compact Edition" href="http://support.microsoft.com/default.aspx/kb/950550">Description
of the various build versions of SQL Server Compact Edition</a>.
</p>
        <p>
The sample does not do version checking on the binaries. Therefore it does not detect
if you are upgrading from SQLCE 3.5 SP1 to SP2. The way it is written now, it will
not update the binaries to SP2. This sample does address the popular scenario of updating
an ‘off the shelf’ device with the latest version of SQL Server Compact.
</p>
        <p>
More SQL Server Compact Links: <script type="text/javascript" src="http://feeds.delicious.com/v2/js/mjfusa/sqlce?title=&amp;count=15&amp;bullet=%C2%BB&amp;sort=alpha"></script>Mike
</p>
        <div class="wlWriterHeaderFooter" style="margin:0px; padding:0px 0px 0px 0px;">This
work is licensed under a <a href="http://creativecommons.org/licenses/by/3.0/">Creative
Commons license.</a></div>
      </body>
      <title>Install SQL Server Compact using the MultiCAB pattern</title>
      <guid isPermaLink="false">http://blog.mjfnet.com/Blog/PermaLink,guid,7fa578ed-150d-4236-8183-cf5cb3b79a16.aspx</guid>
      <link>http://blog.mjfnet.com/Blog/2010/04/30/InstallSQLServerCompactUsingTheMultiCABPattern.aspx</link>
      <pubDate>Fri, 30 Apr 2010 20:51:03 GMT</pubDate>
      <description>&lt;p&gt;
&lt;em&gt;Update: I've updated the sample to be independent of the '\Program Files' string.
Also, the sample now supports installing onto a Storage Card. &lt;/em&gt;
&lt;/p&gt;
&lt;p&gt;
A popular sample for demonstrating how to install application dependencies via embedded
CAB files is &lt;a href="http://msdn.microsoft.com/en-us/library/bb158796.aspx"&gt;MultiCAB
Install&lt;/a&gt;. With this pattern you can distribute dependant cab files via a single
container CAB. “Can apps be distributed via &lt;a href="http://developer.windowsphone.com"&gt;Windows
Marketplace for Mobile&lt;/a&gt; using this?”,you ask. Yes they can.
&lt;/p&gt;
&lt;p&gt;
Installing SQL Server Compact dependencies is a good fit for this pattern. I have
updated the sample &lt;a href="http://blog.mjfnet.com/files/multicabinstall.zip"&gt;here&lt;/a&gt; customized
to distribute the &lt;a href="http://www.microsoft.com/downloads/details.aspx?familyid=5544C638-C532-48E3-871C-58B49C5D855C&amp;amp;displaylang=en"&gt;latest&lt;/a&gt; SQL
Server Compact for Windows Mobile devices.
&lt;/p&gt;
&lt;p&gt;
The sample checks if SQL Server Compact 3.5 is installed (See IsSQLCEUpdateRequired()
in mcsetup.cpp) and if not, launches the multicab EXE which installs each dependant
cab in sequence. (See the multicab whitepaper included in the sample for an in-depth
explanation of how it works.) 
&lt;/p&gt;
&lt;p&gt;
How does the sample check to see if v3.5 is installed? It checks the registry for
the following entry:
&lt;/p&gt;
&lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:2e569270-d267-48bb-9474-3ecb7078dbe6" class="wlWriterEditableSmartContent"&gt;
&lt;div style="border: #000080 1px solid; color: #000; font-family: 'Courier New', Courier, Monospace; font-size: 10pt"&gt;
&lt;div style="background: #fff; max-height: 300px; overflow: auto"&gt;
&lt;ol style="background: #ffffff; margin: 0; padding: 0 0 0 5px; white-space: nowrap"&gt;
&lt;li&gt;
&amp;#92;&lt;span style="color:#a31515"&gt;Software&amp;#92;Microsoft&amp;#92;Microsoft SQL Server Compact
Edition&amp;#92;v3.5&lt;/span&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;
This this exists, then installation of the SQLCE cabs is skipped. Note that this registry
key only exists if SQLCE has been installed via a CAB file. That is, this registry
key does not exist of SQLCE is in ROM. As of this writing, 3.5 (SP1 or SP2) is not
distributed in ROM. See here for a list of OS and corresponding SQLCE versions: &lt;a title="Description of the various build versions of SQL Server Compact Edition" href="http://support.microsoft.com/default.aspx/kb/950550"&gt;Description
of the various build versions of SQL Server Compact Edition&lt;/a&gt;.
&lt;/p&gt;
&lt;p&gt;
The sample does not do version checking on the binaries. Therefore it does not detect
if you are upgrading from SQLCE 3.5 SP1 to SP2. The way it is written now, it will
not update the binaries to SP2. This sample does address the popular scenario of updating
an ‘off the shelf’ device with the latest version of SQL Server Compact.
&lt;/p&gt;
&lt;p&gt;
More SQL Server Compact Links: &lt;script type="text/javascript" src="http://feeds.delicious.com/v2/js/mjfusa/sqlce?title=&amp;amp;count=15&amp;amp;bullet=%C2%BB&amp;amp;sort=alpha"&gt;&lt;/script&gt;Mike
&lt;/p&gt;
&lt;div class="wlWriterHeaderFooter" style="margin:0px; padding:0px 0px 0px 0px;"&gt;This
work is licensed under a &lt;a href="http://creativecommons.org/licenses/by/3.0/"&gt;Creative
Commons license.&lt;/a&gt;
&lt;/div&gt;</description>
      <comments>http://blog.mjfnet.com/Blog/CommentView,guid,7fa578ed-150d-4236-8183-cf5cb3b79a16.aspx</comments>
      <category>Setup</category>
      <category>sqlce</category>
      <category>Windows Mobile</category>
    </item>
    <item>
      <trackback:ping>http://blog.mjfnet.com/Blog/Trackback.aspx?guid=aead9817-4204-48c9-8a97-3990ae268092</trackback:ping>
      <pingback:server>http://blog.mjfnet.com/Blog/pingback.aspx</pingback:server>
      <pingback:target>http://blog.mjfnet.com/Blog/PermaLink,guid,aead9817-4204-48c9-8a97-3990ae268092.aspx</pingback:target>
      <dc:creator>Mike Francis</dc:creator>
      <wfw:comment>http://blog.mjfnet.com/Blog/CommentView,guid,aead9817-4204-48c9-8a97-3990ae268092.aspx</wfw:comment>
      <wfw:commentRss>http://blog.mjfnet.com/Blog/SyndicationService.asmx/GetEntryCommentsRss?guid=aead9817-4204-48c9-8a97-3990ae268092</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
I was developing a few themes for Standard and Professional devices (using the <a href="http://www.microsoft.com/windowsmobile/en-us/downloads/theme-generator.mspx">Windows
Phone Custom Theme Generator</a> tool to get me started) and found that when installing
the CAB on Standard devices, I would get the following error:
</p>
        <p>
          <a href="http://mjfnet.com/blog/content/binary/HowtomakechangestoCABfilewithout.INFfile_A979/BuildMaxError.png">
            <img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="The program you have installed may not display properly because it was designed for a previous version of Windows Mobile software." border="0" alt="The program you have installed may not display properly because it was designed for a previous version of Windows Mobile software." src="http://mjfnet.com/blog/content/binary/HowtomakechangestoCABfilewithout.INFfile_A979/BuildMaxError_thumb.png" width="176" height="220" />
          </a>
        </p>
        <p>
Normally to fix this error, you would edit the .INF file and add <a href="http://msdn.microsoft.com/en-us/library/ee504659.aspx">BuildMax</a>=0xE0000000
to the CEDevice section as follows (See <a href="http://msdn.microsoft.com/en-us/library/ee504659.aspx">here</a> for
explanation of BuildMax): 
</p>
        <p>
[CEDevice]<br />
VersionMin = 3.0<br />
VersionMax = 100.0<br /><a href="http://msdn.microsoft.com/en-us/library/ee504659.aspx"><strong>BuildMax</strong></a><strong>=0xE0000000 </strong></p>
        <p>
In this case, I did not have an .INF file since the CAB was generated by the Theme
Generator. Doing a Bing search, I found a great tool (Benoit Thonnart's <a href="http://www.codeppc.com/telechargements/msceinf/msceinf.htm">MSCEInf</a>)
that helps with the process of creating a .INF file from a CAB file and extracting
files from the CAB with the true filenames. Using this tool, I created the .INF file,
edited it, and then recreated the CAB file using the .INF file and CABWIZ.EXE. MSCEinf’s
feature of extracting the true filename saves a lot of time, saving you the drudgery
of renaming the files, as specified in the _setup.xml file, by hand.  (When CABWIZ
creates the CAB, it converts the filenames to 8.3 names). 
</p>
        <p>
Step-by-Step guide: 
</p>
        <ul>
          <li>
Create dedicated destination directory. 
</li>
          <li>
Copy MSCEInfEn to this directory. 
</li>
          <li>
Create .INF file.  
<ul><li>
Start MSCEInfEn.EXE 
<ul><li>
Open the CAB file 
</li><li>
Click on the icon in upper left, ‘Save INF File rebuilt’ to save .INF file. 
</li></ul></li></ul></li>
          <li>
Extract files from CAB, using the true filenames 
<ul><li>
Using MSCEInfEn,  turn Off ‘Use Folders’ 
<ul><li>
Click 5<sup>th</sup> button from left ‘Extract Filenames’ (should see icon with red
X through it). 
</li></ul></li><li>
Using MSCEInfEn,  extract files 
<ul><li>
Click 4<sup>th</sup> button from left ‘Extract CAB files with original names in a
folder’. 
</li><li>
Click ‘Extract’ and select the destination directory. 
</li></ul></li></ul></li>
          <li>
At this point you should have the files of your theme / application and the .INF file
in the destination directory. 
</li>
          <li>
Modify .INF file 
<ul><li>
Open .INF file saved in Step 1 and add the following line below [CEStrings] 
<ul><li>
[CEDevice] 
<br />
BuildMax=0xE0000000 
</li></ul></li><li>
Save .INF file 
</li></ul></li>
          <li>
Rebuild CAB file. 
<ul><li>
Start a Command Line. (Start | Run | cmd) 
</li><li>
Change to the destination directory. 
</li><li>
Using CABWIZ.EXE recreate the cab file with the following command: 
<ul><li>
Cabwiz &lt;filename&gt;.inf 
</li><li>
You may see a warning regarding AddReg, this can be ignored. 
</li></ul></li></ul></li>
          <li>
Test the CAB file. 
</li>
        </ul>
        <p>
Thanks,
</p>
        <p>
Mike
</p>
      </body>
      <title>How to make changes to CAB file – without an .INF file</title>
      <guid isPermaLink="false">http://blog.mjfnet.com/Blog/PermaLink,guid,aead9817-4204-48c9-8a97-3990ae268092.aspx</guid>
      <link>http://blog.mjfnet.com/Blog/2009/12/30/HowToMakeChangesToCABFileWithoutAnINFFile.aspx</link>
      <pubDate>Wed, 30 Dec 2009 18:38:41 GMT</pubDate>
      <description>&lt;p&gt;
I was developing a few themes for Standard and Professional devices (using the &lt;a href="http://www.microsoft.com/windowsmobile/en-us/downloads/theme-generator.mspx"&gt;Windows
Phone Custom Theme Generator&lt;/a&gt; tool to get me started) and found that when installing
the CAB on Standard devices, I would get the following error:
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://mjfnet.com/blog/content/binary/HowtomakechangestoCABfilewithout.INFfile_A979/BuildMaxError.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="The program you have installed may not display properly because it was designed for a previous version of Windows Mobile software." border="0" alt="The program you have installed may not display properly because it was designed for a previous version of Windows Mobile software." src="http://mjfnet.com/blog/content/binary/HowtomakechangestoCABfilewithout.INFfile_A979/BuildMaxError_thumb.png" width="176" height="220"&gt;&lt;/a&gt; 
&lt;/p&gt;
&lt;p&gt;
Normally to fix this error, you would edit the .INF file and add &lt;a href="http://msdn.microsoft.com/en-us/library/ee504659.aspx"&gt;BuildMax&lt;/a&gt;=0xE0000000
to the CEDevice section as follows (See &lt;a href="http://msdn.microsoft.com/en-us/library/ee504659.aspx"&gt;here&lt;/a&gt; for
explanation of BuildMax): 
&lt;p&gt;
[CEDevice]&lt;br&gt;
VersionMin = 3.0&lt;br&gt;
VersionMax = 100.0&lt;br&gt;
&lt;a href="http://msdn.microsoft.com/en-us/library/ee504659.aspx"&gt;&lt;strong&gt;BuildMax&lt;/strong&gt;&lt;/a&gt;&lt;strong&gt;=0xE0000000 &lt;/strong&gt; 
&lt;p&gt;
In this case, I did not have an .INF file since the CAB was generated by the Theme
Generator. Doing a Bing search, I found a great tool (Benoit Thonnart's &lt;a href="http://www.codeppc.com/telechargements/msceinf/msceinf.htm"&gt;MSCEInf&lt;/a&gt;)
that helps with the process of creating a .INF file from a CAB file and extracting
files from the CAB with the true filenames. Using this tool, I created the .INF file,
edited it, and then recreated the CAB file using the .INF file and CABWIZ.EXE. MSCEinf’s
feature of extracting the true filename saves a lot of time, saving you the drudgery
of renaming the files, as specified in the _setup.xml file, by hand.&amp;nbsp; (When CABWIZ
creates the CAB, it converts the filenames to 8.3 names). 
&lt;p&gt;
Step-by-Step guide: 
&lt;ul&gt;
&lt;li&gt;
Create dedicated destination directory. 
&lt;li&gt;
Copy MSCEInfEn to this directory. 
&lt;li&gt;
Create .INF file.&amp;nbsp; 
&lt;ul&gt;
&lt;li&gt;
Start MSCEInfEn.EXE 
&lt;ul&gt;
&lt;li&gt;
Open the CAB file 
&lt;li&gt;
Click on the icon in upper left, ‘Save INF File rebuilt’ to save .INF file. 
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;li&gt;
Extract files from CAB, using the true filenames 
&lt;ul&gt;
&lt;li&gt;
Using MSCEInfEn,&amp;nbsp; turn Off ‘Use Folders’ 
&lt;ul&gt;
&lt;li&gt;
Click 5&lt;sup&gt;th&lt;/sup&gt; button from left ‘Extract Filenames’ (should see icon with red
X through it). 
&lt;/li&gt;
&lt;/ul&gt;
&lt;li&gt;
Using MSCEInfEn,&amp;nbsp; extract files 
&lt;ul&gt;
&lt;li&gt;
Click 4&lt;sup&gt;th&lt;/sup&gt; button from left ‘Extract CAB files with original names in a
folder’. 
&lt;li&gt;
Click ‘Extract’ and select the destination directory. 
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;li&gt;
At this point you should have the files of your theme / application and the .INF file
in the destination directory. 
&lt;li&gt;
Modify .INF file 
&lt;ul&gt;
&lt;li&gt;
Open .INF file saved in Step 1 and add the following line below [CEStrings] 
&lt;ul&gt;
&lt;li&gt;
[CEDevice] 
&lt;br&gt;
BuildMax=0xE0000000 
&lt;/li&gt;
&lt;/ul&gt;
&lt;li&gt;
Save .INF file 
&lt;/li&gt;
&lt;/ul&gt;
&lt;li&gt;
Rebuild CAB file. 
&lt;ul&gt;
&lt;li&gt;
Start a Command Line. (Start | Run | cmd) 
&lt;li&gt;
Change to the destination directory. 
&lt;li&gt;
Using CABWIZ.EXE recreate the cab file with the following command: 
&lt;ul&gt;
&lt;li&gt;
Cabwiz &amp;lt;filename&amp;gt;.inf 
&lt;li&gt;
You may see a warning regarding AddReg, this can be ignored. 
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;li&gt;
Test the CAB file. 
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
Thanks,
&lt;/p&gt;
&lt;p&gt;
Mike
&lt;/p&gt;</description>
      <comments>http://blog.mjfnet.com/Blog/CommentView,guid,aead9817-4204-48c9-8a97-3990ae268092.aspx</comments>
      <category>Setup</category>
      <category>Themes</category>
      <category>Tools</category>
      <category>Windows Mobile</category>
    </item>
  </channel>
</rss>