原文 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;

最新文章

  1. C++实现DNS域名解析
  2. BigDecimal用法详解
  3. python打印服务器所有进程
  4. 在python中使用concurrent.futures实现进程池和线程池
  5. 安装生物信息学软件-Samtools
  6. nignx重启启动关闭
  7. TypeScript学习笔记(五):接口
  8. bootstrap学习以及其插件
  9. EZOJ 网同14(蛋蛋与北大信科-Splay的颜色分离,寻找结点所在子树)
  10. Lua: 给 Redis 用户的入门指导
  11. linux修改句柄数
  12. SEO-外部链接类型以及标准
  13. Oracle 12C 新特性之 PDB热克隆(本地克隆、远端异机克隆)
  14. spring+struts2+hibernate整合
  15. 深入分析synchronized的实现原理
  16. 【Spring】Autowired原理及与Resource注解区别
  17. P1140 相似基因 最长公共子序列
  18. 利用python如何实现团队成员动态抓阄?
  19. Linux 安装操作系统标准
  20. 2018 Jar_Feb_Newwords

热门文章

  1. 注册表添加python
  2. UVA 816 Abbott’s Revenge
  3. Python中各种集合 list tuple set dict
  4. linux 启动 oracle数据库
  5. TimeSpan类【转】
  6. android典型监听事件实
  7. linux 命令入门
  8. jQuery的主要用法
  9. asp.net 一个简单的登录控制
  10. 工厂类分离与java反射机制