CAB如何打包能将程序安装到存储卡

lightfoot 2010-04-20 04:23:16
目前我是用VS2005打的CAB包,打包时安装路径已经写死了
安装时,手机会弹出对话框问你是安装到设备还是存储卡
但无论选哪个,程序都会安装到设备上

想知道怎么操作或者免费的工具,可以让用户动态选择安装到设备或者存储卡上
...全文
196 13 打赏 收藏 转发到动态 举报
写回复
用AI写文章
13 条回复
切换为时间正序
请发表友善的回复…
发表回复
lightfoot 2010-04-27
  • 打赏
  • 举报
回复
我在Setup.dll中使用如下函数,但快捷方式还是创建不成功,高手再指点一下
Install_Exit(
HWND hwndParent,
LPCTSTR pszInstallDir, // final install directory
WORD cFailedDirs,
WORD cFailedFiles,
WORD cFailedRegKeys,
WORD cFailedRegVals,
WORD cFailedShortcuts)
{
WCHAR szLinkPath[MAX_PATH];
WCHAR szAppPath[MAX_PATH];

if(SHGetSpecialFolderPath(NULL, szLinkPath, CSIDL_PROGRAMS, FALSE)){
_tcscat(szLinkPath, _T("程序.lnk"));

DeleteFile(szLinkPath);

_tcscpy(szAppPath, pszInstallDir);
_tcscat(szAppPath, _T("//WM6.exe"));
if(SHCreateShortcut(szLinkPath, szAppPath) == FALSE){
MessageBox(NULL, _T("安装快捷方式失败"), _T("提示"), MB_OK);
}
} else {
MessageBox(NULL, _T("获取系统文件路径1失败"), _T("提示"), MB_OK);
}
}
Juncof 2010-04-22
  • 打赏
  • 举报
回复
C:\Program Files\Windows Mobile 6 SDK\Samples\Common\CPP\Win32\SetupDLL

// **************************************************************************
// Function Name: Install_Exit
//
// Purpose: processes the push message.
//
// Arguments:
// IN HWND hwndParent handle to the parent window
// IN LPCTSTR pszInstallDir name of the user-selected install directory of the application
//
// Return Values:
// codeINSTALL_EXIT
// returns install status
//
// Description:
// Register query client with the PushRouter as part of installation.
// Only the first two parameters really count.
// **************************************************************************
SETUP_API codeINSTALL_EXIT Install_Exit(
HWND hwndParent,
LPCTSTR pszInstallDir, // final install directory
WORD cFailedDirs,
WORD cFailedFiles,
WORD cFailedRegKeys,
WORD cFailedRegVals,
WORD cFailedShortcuts
)

在这个函数里面创建中文快捷方式:
if(SHGetSpecialFolderPath(NULL, szLinkPath, CSIDL_PROGRAMS,FALSE))
{
_tcscat(szLinkPath, _T("中文快捷方式.lnk"));

DeleteFile(szLinkPath);

if(SHCreateShortcut(szLinkPath, szAppPath) == FALSE)
{
//MessageBox(NULL, _T("安装快捷方式失败"), _T("提示"), MB_OK);
}
}
else
{
//MessageBox(NULL, _T("获取系统文件路径失败"), _T("提示"), MB_OK);
}

在安装工程里面设置 CE Setup Dll 为:SetupDLL.dll
funwell 2010-04-22
  • 打赏
  • 举报
回复
[Quote=引用 4 楼 lightfoot 的回复:]
多谢,已经找到解决的办法了
用CAB工程打包时,文件放在“Application Folder”目录下,就可以动态选择安装到设备还是存储卡

多问一句,如果快捷方式想使用中文的话,怎么处理?
CAB Manager 3.0是收费软件~~
[/Quote]

在安装包的setup.dll里面自己创建快捷方式,采用SHCreateShortcut这个api。
  • 打赏
  • 举报
回复
用WinCE CAB Manager 3.0 打包就OK 而且支持中文
  • 打赏
  • 举报
回复
用WinCE CAB Manager 3.0 打包就OK 而且支持中文
  • 打赏
  • 举报
回复
用WinCE CAB Manager 3.0 打包就OK 而且支持中文
biosli 2010-04-20
  • 打赏
  • 举报
回复
楼主的问题出在打包路径上,仔细研究一下工程提供的几个目录都是指的什么。
忆龙2009 2010-04-20
  • 打赏
  • 举报
回复
我也同样遇到不能用中文名字的问题.
lightfoot 2010-04-20
  • 打赏
  • 举报
回复

多谢,已经找到解决的办法了
用CAB工程打包时,文件放在“Application Folder”目录下,就可以动态选择安装到设备还是存储卡

多问一句,如果快捷方式想使用中文的话,怎么处理?
CAB Manager 3.0是收费软件~~
北方大冬瓜 2010-04-20
  • 打赏
  • 举报
回复
打包的路径别写死就可以了
zytkwlh 2010-04-20
  • 打赏
  • 举报
回复
为什么在打包的时候要写死安装路径呀,重新打包不久可以了吗
世外涛缘 2010-04-20
  • 打赏
  • 举报
回复
cab manager3.0

7,655

社区成员

发帖
与我相关
我的任务
社区描述
Windows Phone是微软发布的一款手机操作系统,它将微软旗下的Xbox LIVE游戏、Zune音乐与独特的视频体验整合至手机中。
社区管理员
  • Windows客户端开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧