How to change the device-based output file folder

First, I'll start with what I'm trying to accomplish, then I will talk about contextual details:

When I select "Start Debugging", I want the output directory to change depending on which device is connected through the Windows Mobile Device Center. Explanation . Installation from our installer works fine, but debugging from Visual Studio is what causes the problems.

I am using Visual Studio 2008. A project is a Smart Device project written in C # for Compact Framework 3.5 and designed for Windows Mobile 5.0 Pocket PC Device R2 (in accordance with the project settings). I found that when I target this type of device, it works correctly in all versions of Windows Mobile that we support with Windows CE 6. Any proposed solution should work on both Windows Mobile and Windows CE.

When I go to the "Properties" project and go to the "Devices" tab, the "Output file" folder will appear and the path to output. If I click the button ..., I can change this to different default values ​​or even set it to the Root folder, and then completely specify the exact path that I want as a subdirectory. On most devices, if I just leave it (the default is “Device”) or select “Program Files Folder” from the drop-down list, it works fine. The problem is that when working with the Windows CE device that we support, it must start from another location.

Possible solutions :

Multiple projects Solution: have multiple projects for different devices. The problem with this is that I don’t know how to do this without violating the DRY principle for some files that need to be included in the output file, and I don’t want to switch between different Start projects.

Override the solution %CSIDL_PROGRAM_FILES%: change the value %CSIDL_PROGRAM_FILES%, as it may be in the output path that determines where the program files are located. However, I do not know if this is possible or where to start by trying this. I thought it might be defined in the device registry, but I can’t find it.

: " ", "" - (, %?) , , (, - ( ) script). , .

, !

EDIT:

, , %CSIDL_PROGRAM_FILES% - Windows CE. , .

+5
3

/ :

VS "Configuration Manager", enter image description here

" " enter image description here

. " " ""

. enter image description here

"", .

, , "" enter image description here

.

"Release_Device1": enter image description here

"Release": enter image description here

: enter image description here

?

+1

:

    <DeploymentTool
    ForceDirty="-1"
    RemoteDirectory="$(ceRemoteDir)"
    RegisterOutput="0"
    AdditionalFiles=""
/>

, , VS .

script .

preg, script:

pregutl.exe hklm\Ident

, , :

[HKLM\Ident]
Desc=""
Name="CK7007121144066"
OrigName="Pocket_PC"
Restriction=dword:00000002
Username="guest"

, :

[HKLM\Ident]
Desc="Intermec CN3 Device"
Name="CN3A32110646073"
OrigName="IntermecCN3"
Restriction=dword:00000002
Username="guest"

bat/cmd, pput exe pregutl.

bat/cmd VS - .

, , .

0

, , :

  • , ,

  • , , (\Program Files\Data).

( VS2008) .

!

josef. ?

0

All Articles