467,136 Members | 1,291 Online
Bytes | Developer Community
Ask Question

Home New Posts Topics Members FAQ

Post your question to a community of 467,136 developers. It's quick & easy.

Copying a .sdf file to Pocket PC on install

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\Inven toryCounter\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\<appNamedirectory 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!

Jul 11 '06 #1
  • viewed: 3420
Share:
4 Replies
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" <ro*********@gmail.comwrote in message
news:11**********************@m73g2000cwd.googlegr oups.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\Inven toryCounter\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\<appNamedirectory 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!

Jul 12 '06 #2
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 Goncharov wrote:
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" <ro*********@gmail.comwrote in message
news:11**********************@m73g2000cwd.googlegr oups.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\Inven toryCounter\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\<appNamedirectory 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!
Jul 12 '06 #3
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" <ro*********@gmail.comwrote in message
news:11**********************@m79g2000cwm.googlegr oups.com...
>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 Goncharov wrote:
>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" <ro*********@gmail.comwrote in message
news:11**********************@m73g2000cwd.googleg roups.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\Inven toryCounter\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\<appNamedirectory 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!

Jul 13 '06 #4
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/de...deployment.asp
http://www.codeproject.com/netcf/Pac...ployingPPC.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 Goncharov wrote:
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" <ro*********@gmail.comwrote in message
news:11**********************@m79g2000cwm.googlegr oups.com...
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 Goncharov wrote:
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" <ro*********@gmail.comwrote in message
news:11**********************@m73g2000cwd.googlegr oups.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\Inven toryCounter\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\<appNamedirectory 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!
Jul 13 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

11 posts views Thread by Abhishek | last post: by
8 posts views Thread by Randy | last post: by
8 posts views Thread by Krishnan Margabandhu | last post: by
2 posts views Thread by Kent Briggs | last post: by
3 posts views Thread by ipointer | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.