Copying a .sdf file to Pocket PC on install

R

Robert Iver

Hello everyone,

I am trying to create an application that utilizes a SQL
Mobile database. I have included that database in my main project, and
it compiles and debugs just fine.

I then created a custom installer project packaged as a class
library and made an installer project to wrap the whole thing up into
an MSI package. Basically the idea behind doing all this is so the
handheld app can be pushed out through group policy.

So far everything has gone according to plan, except for two
things....first thing is that I cannot get shortcuts to show up on the
device for my app, no matter what I do. I've created an .inf file that
SHOULD do it.....here's a snippet from the file:
_____________________________________________________________________
[CEStrings]
AppName="Inventory Counter"
InstallDir=%CE1%\%AppName%

[CEDevice]
VersionMin=3.00
VersionMax=4.99

[DefaultInstall]
CEShortcuts=Shortcuts
CopyFiles=Files.Common

[SourceDisksNames]
1=,"Common",,"C:\Code\MobileInventoryCounter\InventoryCounter\bin\Release"

[SourceDisksFiles]
InventoryCounter.exe=1

[DestinationDirs]
Files.Common=0,%InstallDir%
Shortcuts=0,%CE2%\Start Menu

[Files.Common]
InventoryCounter.exe,,,0

[Shortcuts]
Inventory Counter,0,InventoryCounter.exe,%CE11%
__________________________________________________________________

The second problem I'm having is a simple one, but I can't figure out
how to do it. I need to copy the SQL Mobile database file to the
\Program Files\<appName> directory on the device, but can't find any
options or parameters inside Visual Studio to do that. I'm new to VS
2005, but have used prior versions, so maybe it's something I'm
missing....Thanks for your help!
 
Y

Yaroslav Goncharov

It is not recommended to use any hardcoded strings in shortcut locations
(like "Start Menu" in the following fragment Shortcuts=0,%CE2%\Start Menu).
Find the %CE??% that translates to the folder you need and use instead of a
hardcoded value.

For the second problem you can use a Remote File Viewer or ActiveSync to
copy the files you need to the device. If you want to deploy a file
automatically, use "Additional Files" field in the Project
Properties->Configuration Properties->Deployment.
 
R

Robert Iver

I tried changing it to a "macro" value like %CE1% and no dice on the
shortcuts.

As far as the file, I've tried just about everything I can find online
and still nothing... I'm getting read to start digging into the
documentation. I'm VERY open to suggestions at this point, so please
let me know if you have anything for me.

Wish me luck in my documentation browsing.


Yaroslav said:
It is not recommended to use any hardcoded strings in shortcut locations
(like "Start Menu" in the following fragment Shortcuts=0,%CE2%\Start Menu).
Find the %CE??% that translates to the folder you need and use instead of a
hardcoded value.

For the second problem you can use a Remote File Viewer or ActiveSync to
copy the files you need to the device. If you want to deploy a file
automatically, use "Additional Files" field in the Project
Properties->Configuration Properties->Deployment.

--
Yaroslav Goncharov
Spb Software House, http://spbsoftwarehouse.com
Pocket PC Developer Network, http://pocketpcdn.com


Robert Iver said:
Hello everyone,

I am trying to create an application that utilizes a SQL
Mobile database. I have included that database in my main project, and
it compiles and debugs just fine.

I then created a custom installer project packaged as a class
library and made an installer project to wrap the whole thing up into
an MSI package. Basically the idea behind doing all this is so the
handheld app can be pushed out through group policy.

So far everything has gone according to plan, except for two
things....first thing is that I cannot get shortcuts to show up on the
device for my app, no matter what I do. I've created an .inf file that
SHOULD do it.....here's a snippet from the file:
_____________________________________________________________________
[CEStrings]
AppName="Inventory Counter"
InstallDir=%CE1%\%AppName%

[CEDevice]
VersionMin=3.00
VersionMax=4.99

[DefaultInstall]
CEShortcuts=Shortcuts
CopyFiles=Files.Common

[SourceDisksNames]
1=,"Common",,"C:\Code\MobileInventoryCounter\InventoryCounter\bin\Release"

[SourceDisksFiles]
InventoryCounter.exe=1

[DestinationDirs]
Files.Common=0,%InstallDir%
Shortcuts=0,%CE2%\Start Menu

[Files.Common]
InventoryCounter.exe,,,0

[Shortcuts]
Inventory Counter,0,InventoryCounter.exe,%CE11%
__________________________________________________________________

The second problem I'm having is a simple one, but I can't figure out
how to do it. I need to copy the SQL Mobile database file to the
\Program Files\<appName> directory on the device, but can't find any
options or parameters inside Visual Studio to do that. I'm new to VS
2005, but have used prior versions, so maybe it's something I'm
missing....Thanks for your help!
 
Y

Yaroslav Goncharov

I would recommend to start from a cab sample you can find in the SDK. Then
modify it step by step to suit your needs. At the end you should get a cab
file that works.

--
Yaroslav Goncharov
Spb Software House, http://spbsoftwarehouse.com
Pocket PC Developer Network, http://pocketpcdn.com


Robert Iver said:
I tried changing it to a "macro" value like %CE1% and no dice on the
shortcuts.

As far as the file, I've tried just about everything I can find online
and still nothing... I'm getting read to start digging into the
documentation. I'm VERY open to suggestions at this point, so please
let me know if you have anything for me.

Wish me luck in my documentation browsing.


Yaroslav said:
It is not recommended to use any hardcoded strings in shortcut locations
(like "Start Menu" in the following fragment Shortcuts=0,%CE2%\Start
Menu).
Find the %CE??% that translates to the folder you need and use instead of
a
hardcoded value.

For the second problem you can use a Remote File Viewer or ActiveSync to
copy the files you need to the device. If you want to deploy a file
automatically, use "Additional Files" field in the Project
Properties->Configuration Properties->Deployment.

--
Yaroslav Goncharov
Spb Software House, http://spbsoftwarehouse.com
Pocket PC Developer Network, http://pocketpcdn.com


Robert Iver said:
Hello everyone,

I am trying to create an application that utilizes a SQL
Mobile database. I have included that database in my main project, and
it compiles and debugs just fine.

I then created a custom installer project packaged as a class
library and made an installer project to wrap the whole thing up into
an MSI package. Basically the idea behind doing all this is so the
handheld app can be pushed out through group policy.

So far everything has gone according to plan, except for two
things....first thing is that I cannot get shortcuts to show up on the
device for my app, no matter what I do. I've created an .inf file that
SHOULD do it.....here's a snippet from the file:
_____________________________________________________________________
[CEStrings]
AppName="Inventory Counter"
InstallDir=%CE1%\%AppName%

[CEDevice]
VersionMin=3.00
VersionMax=4.99

[DefaultInstall]
CEShortcuts=Shortcuts
CopyFiles=Files.Common

[SourceDisksNames]
1=,"Common",,"C:\Code\MobileInventoryCounter\InventoryCounter\bin\Release"

[SourceDisksFiles]
InventoryCounter.exe=1

[DestinationDirs]
Files.Common=0,%InstallDir%
Shortcuts=0,%CE2%\Start Menu

[Files.Common]
InventoryCounter.exe,,,0

[Shortcuts]
Inventory Counter,0,InventoryCounter.exe,%CE11%
__________________________________________________________________

The second problem I'm having is a simple one, but I can't figure out
how to do it. I need to copy the SQL Mobile database file to the
\Program Files\<appName> directory on the device, but can't find any
options or parameters inside Visual Studio to do that. I'm new to VS
2005, but have used prior versions, so maybe it's something I'm
missing....Thanks for your help!
 
R

Robert Iver

Thank you for your responses Yaroslav. I ended up getting it working.
For everyone that is reading this post and is having the same problem I
did, here's what I did to fix my problem:

First, I have to give credit to the following two websites for giving
me the bulk of the information that I needed to get it working:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnppcgen/html/netcfdeployment.asp
http://www.codeproject.com/netcf/PackagingAndDeployingPPC.asp

The CodeProject Article is the one that I used the most and used the
MSDN article to "fill in the holes" where appropriate.

Basically I started with a setup that you would have at the end of
following the steps in the CodeProject article. What I did differently
was basically let VS generate the CAB files and inf files, and then got
rid of the BuildCabs.bat and .inf files. I created a Smart Cab Project
in VS and added the Primary Output and Content Files from my main
project into the CAB file. I also added the shortcuts that were needed
by right clicking on my Cab Builder Project, clicking View, then File
System. You can create shortcuts to the primary output and then drop
them where ever you'd like a shortcut to show up. I had to add the
Start Menu into the File system by right-clicking the root and add the
Start Menu as a special folder. Then once I had that done, I added the
Primary Outputs from the Smart CAB project into my installer (MSI)
project.

After that, I got rid of the pre-build event in the Custom Installer
and then I had to modify the .ini file that CEAppMgr uses to reflect
the VS generated CAB file. I also had to modify the build order by
using project dependencies.

After all that, I built the solution and it worked!!!

If you are having problems even after all this, e-mail me or better
yet, post something in this group and I'll help in whatever way I can.



Yaroslav said:
I would recommend to start from a cab sample you can find in the SDK. Then
modify it step by step to suit your needs. At the end you should get a cab
file that works.

--
Yaroslav Goncharov
Spb Software House, http://spbsoftwarehouse.com
Pocket PC Developer Network, http://pocketpcdn.com


Robert Iver said:
I tried changing it to a "macro" value like %CE1% and no dice on the
shortcuts.

As far as the file, I've tried just about everything I can find online
and still nothing... I'm getting read to start digging into the
documentation. I'm VERY open to suggestions at this point, so please
let me know if you have anything for me.

Wish me luck in my documentation browsing.


Yaroslav said:
It is not recommended to use any hardcoded strings in shortcut locations
(like "Start Menu" in the following fragment Shortcuts=0,%CE2%\Start
Menu).
Find the %CE??% that translates to the folder you need and use instead of
a
hardcoded value.

For the second problem you can use a Remote File Viewer or ActiveSync to
copy the files you need to the device. If you want to deploy a file
automatically, use "Additional Files" field in the Project
Properties->Configuration Properties->Deployment.

--
Yaroslav Goncharov
Spb Software House, http://spbsoftwarehouse.com
Pocket PC Developer Network, http://pocketpcdn.com


Hello everyone,

I am trying to create an application that utilizes a SQL
Mobile database. I have included that database in my main project, and
it compiles and debugs just fine.

I then created a custom installer project packaged as a class
library and made an installer project to wrap the whole thing up into
an MSI package. Basically the idea behind doing all this is so the
handheld app can be pushed out through group policy.

So far everything has gone according to plan, except for two
things....first thing is that I cannot get shortcuts to show up on the
device for my app, no matter what I do. I've created an .inf file that
SHOULD do it.....here's a snippet from the file:
_____________________________________________________________________
[CEStrings]
AppName="Inventory Counter"
InstallDir=%CE1%\%AppName%

[CEDevice]
VersionMin=3.00
VersionMax=4.99

[DefaultInstall]
CEShortcuts=Shortcuts
CopyFiles=Files.Common

[SourceDisksNames]
1=,"Common",,"C:\Code\MobileInventoryCounter\InventoryCounter\bin\Release"

[SourceDisksFiles]
InventoryCounter.exe=1

[DestinationDirs]
Files.Common=0,%InstallDir%
Shortcuts=0,%CE2%\Start Menu

[Files.Common]
InventoryCounter.exe,,,0

[Shortcuts]
Inventory Counter,0,InventoryCounter.exe,%CE11%
__________________________________________________________________

The second problem I'm having is a simple one, but I can't figure out
how to do it. I need to copy the SQL Mobile database file to the
\Program Files\<appName> directory on the device, but can't find any
options or parameters inside Visual Studio to do that. I'm new to VS
2005, but have used prior versions, so maybe it's something I'm
missing....Thanks for your help!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top