1.在已有软件安装步骤中添加自定义信息,比如在卸载前先停止相关服务,只需在系统预定义的function中添加内容即可,后续安装包将自动调用该函数;其它可能用的函数如OnMoved,注意OnMoved只会移除安装包自己安装的内容,对于后续程序产生的内容,不会进行移除,这也是很多软件卸载后有残留文件的原因;若要完整卸载,可在OnMoved中添加DeleteDir("d:\\xx",ALLCONTENTS),删除文件夹。
//--------------------------------------------------------------------------- // OnMoving // // The OnMoving event is called just after the standard MSI action // 'InstallInitialize' is executed. //--------------------------------------------------------------------------- function OnMoving() string szParam; begin if(REMOVEALLMODE) then MessageBox("请确认已停止xxx,否则无法完整卸载!",INFORMATION); endif; end;
2.完全自定义function,在安装步骤中插入该操作。
export prototype preDelNodeModules(); function preDelNodeModules() begin DeleteDir("C:\\xx",ALLCONTENTS); end;
自定义安装的action,关联上自定义function。
在安装顺序中插入自定义action。