WCE下打包下安装启动setup DLL

#include <windows.h>

#include "ce_setup.h"


/* This is the entry point of the DLL. This DLL is to be used during */

BOOL APIENTRY DllMain( HANDLE hModule,
DWORD ul_reason_for_call,
LPVOID lpReserved
)
{
return TRUE;
}


/* This function will be executed before the install starts */

codeINSTALL_INIT Install_Init(HWND hwndParent,
BOOL fFirstCall,
BOOL fPreviouslyInstalled,
LPCTSTR pszInstallDir)
{
if(fFirstCall)
{
/* TO DO: Add any "one time only" initialization code here. */
MessageBox(NULL, "First installation: preinstall", "preinstall", MB_OK);
}
else
{
/* TO DO: Add your code here. Be sure to take into account the */
/* fact that "pszInstallDir" may be different each time this */
/* function is called! */
MessageBox(NULL, "Subsequent installation: preinstall", "preinstall", MB_OK);
}

return codeINSTALL_INIT_CONTINUE;

}




/* This function will be executed after the install finishes */
codeINSTALL_EXIT Install_Exit(HWND hwndParent,
LPCTSTR pszInstallDir,
WORD cFailedDirs,
WORD cFailedFiles,
WORD cFailedRegKeys,
WORD cFailedRegVals,
WORD cFailedShortcuts)
{
/* First, make sure the installation succeeded */

if(cFailedDirs||cFailedFiles||cFailedRegKeys||cFailedRegVals
||cFailedShortcuts)
{
/* The installation failed, so clean up and exit */


/* TO DO: Undo any actions taken in Install_Init() */

#ifdef __WINBUG

/* WINBUG: codeINSTALL_EXIT_UNINSTALL doesn't work - it causes the*/
/* "Writing uninstall info" dialog to hang. We'll always return */
/* codeINSTALL_EXIT_DONE instead. */
return codeINSTALL_EXIT_DONE;

#else

return codeINSTALL_EXIT_UNINSTALL;

#endif

}


/* IMPORTANT NOTE: */

/* We must register OCX controls ourselves for CE 2.11 Palm-size PC */
/* devices due to a bug in "wceload.exe" that causes the device to */
/* hang while creating registry entries. */

/* If you plan to distribute your application to Palm-size PC users,*/
/* **DO NOT** mark the files as self-registering from within */
/* InstallShield for Windows CE. You will need to register the */
/* controls from within this DLL instead. */



/* TO DO: Add any other controls you need to register below. */


MessageBox(hwndParent, "PostInstall", "PostInstall", MB_OK);
return codeINSTALL_EXIT_DONE;
}




/* This function will be executed before the uninstall starts. */

codeUNINSTALL_INIT Uninstall_Init(HWND hwndParent,
LPCTSTR pszInstallDir)
{

/* Undo anything that was done during install through this DLL, */
/* creating shortcuts etc */
MessageBox(NULL, "Pre-uninstall", "Pre-UnInstall", MB_OK);
return codeUNINSTALL_INIT_CONTINUE;

}

/* This function will be executed after the uninstall finishes */
codeUNINSTALL_EXIT Uninstall_Exit(HWND hwndParent)
{
/* TO DO: Undo any other actions taken during installation and not */
/* cleaned up in Uninstall_Init(). */
MessageBox(NULL, "Post-uninstall", "Post-UnInstall", MB_OKCANCEL);
return codeUNINSTALL_EXIT_DONE;
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值