InstallShield 工程类型installscript,如何覆盖安装?
2024-10-14 13:29:35
原文 http://www.cnblogs.com/daocaorenbx/p/3305162.html
开始使用的msi工程类型。网上找了资料, 在kevin的博客里找到这条方法 可以通过删除Execute Sequence中的RegisterProduct和PublishProduct两个CA实现同样的需求。
试过之后确实是可以 重复安装的,但是 开始菜单的中的卸载是无法卸载的,而且控制面板是不能显示该程序的。所以此方法不可行。
换了个工程类型,使用 installscript工程类型,此类型的 脚本中 advanced下面有个 OnShowUI,即存放的检测是已安装、更新、还是第一次安装 的脚本,修改逻辑第一安装外的情况 继续执行 安装脚本
在 卸载的快捷方式中添加一个参数 -removeonly,检测判断此参数为卸载功能。
修改代码如下:
function OnShowUI()
BOOL bMaintenanceMode, bUpdateMode;
string szIgnore, szTitle;
begin // Enable dialog caching
Enable( DIALOGCACHE ); // Determine what events to show.
bUpdateMode = FALSE;
bMaintenanceMode = FALSE; // Remove this to disabled update mode.
if( UPDATEMODE ) then
bUpdateMode = TRUE;
endif; // Remove this to disable maintenance mode.
if ( MAINTENANCE ) then
bMaintenanceMode = TRUE;
endif; // Show appropriate UI // TODO: Enable if you want to enable background etc.
//if ( LoadStringFromStringTable( "TITLE_MAIN", szTitle ) < ISERR_SUCCESS ) then // Load the title string.
// szTitle = IFX_SETUP_TITLE;
//endif;
//SetTitle( szTitle, 24, WHITE );
//Enable( FULLWINDOWMODE );
//Enable( BACKGROUND );
//SetColor( BACKGROUND, RGB( 0, 128, 128 ) ); /*if( bUpdateMode ) then
OnUpdateUIBefore();
else
if ( bMaintenanceMode ) then
OnMaintUIBefore();
else
OnFirstUIBefore();
endif;
endif; */
// OnFirstUIBefore(); if( REMOVEONLY ) then
// MessageBox ("卸载", SEVERE);
OnMaintUIBefore();
else
if( bUpdateMode ) then
// MessageBox ("更新", SEVERE);
OnUpdateUIBefore();
else
if ( bMaintenanceMode ) then if( MessageBox( "您已安装最新版本,是否覆盖安装?" , MB_YESNO ) != IDYES ) then
abort;
endif;
OnFirstUIBefore();
FeatureReinstall();
else
// MessageBox ("第一次安装", SEVERE);
OnFirstUIBefore();
endif;
endif;
endif; // Move Data
OnMoveData(); //OnFirstUIAfter();
if( REMOVEONLY ) then
OnMaintUIAfter();
else
OnFirstUIAfter();
endif; /*
if( bUpdateMode ) then
OnUpdateUIAfter();
else
if ( bMaintenanceMode ) then
OnMaintUIAfter();
else
OnFirstUIAfter();
endif;
endif;
*/
// Disable dialog caching
Disable(DIALOGCACHE); end;
最新文章
- C++实现DNS域名解析
- BigDecimal用法详解
- python打印服务器所有进程
- 在python中使用concurrent.futures实现进程池和线程池
- 安装生物信息学软件-Samtools
- nignx重启启动关闭
- TypeScript学习笔记(五):接口
- bootstrap学习以及其插件
- EZOJ 网同14(蛋蛋与北大信科-Splay的颜色分离,寻找结点所在子树)
- Lua: 给 Redis 用户的入门指导
- linux修改句柄数
- SEO-外部链接类型以及标准
- Oracle 12C 新特性之 PDB热克隆(本地克隆、远端异机克隆)
- spring+struts2+hibernate整合
- 深入分析synchronized的实现原理
- 【Spring】Autowired原理及与Resource注解区别
- P1140 相似基因 最长公共子序列
- 利用python如何实现团队成员动态抓阄?
- Linux 安装操作系统标准
- 2018 Jar_Feb_Newwords