InstallShield2020打包部署【C#项目】 |
您所在的位置:网站首页 › install11 › InstallShield2020打包部署【C#项目】 |
前段时间一直在搞桌面应用程序打包使用,网上的技术比较老,爬了很多坑,经过摸爬滚打终于完成了。记录一下操作过程。 文章目录 需要的软件需要的文件打包部署步骤新建项目基本信息设置安装校验选择安装的名称选择项目及配置文件软件详情信息选择软件架构installScript安装过程顺序卸载 编译 需要的软件 需要的文件使用vs开发的软件生成的 .exe软件以及相应配置文件 打包部署 步骤 新建项目注意:一定要注意选择项目的类型,如果安装过程中需要用到输入参数,输入信息之类的操作,要选择使用InstallScript MSI。 基本信息设置 安装校验建议都选择默认的 No 选择安装的名称 选择项目及配置文件 软件详情信息 选择软件架构 installScript 安装过程顺序 #include "ifx.h" #include "FeatureEvents.rul" function OnFirstUIBefore() NUMBER nResult, nSetupType, nvSize, nUser; STRING szTitle, szMsg, szQuestion, svName, svCompany, szFile; STRING szLicenseFile; BOOL bCustom, bIgnore1, bIgnore2; begin if( REMOVEONLY ) then Disable( DIALOGCACHE ); szMsg = SdLoadString( IDS_IFX_ERROR_PRODUCT_NOT_INSTALLED_UNINST ); SdSubstituteProductInfo( szMsg ); MessageBox( szMsg, SEVERE ); abort; endif; nSetupType = TYPICAL; Dlg_SdWelcome: szTitle = ""; szMsg = ""; nResult = SdWelcome(szTitle, szMsg); if (nResult = BACK) goto Dlg_SdWelcome; szTitle = ""; svName = ""; svCompany = ""; Dlg_SetupType: szTitle = ""; szMsg = ""; nResult = SetupType2(szTitle, szMsg, "", nSetupType, 0); if (nResult = BACK) then goto Dlg_SdWelcome; else nSetupType = nResult; if (nSetupType != CUSTOM) then nvSize = 0; FeatureCompareSizeRequired(MEDIA, INSTALLDIR, nvSize); if (nvSize != 0) then MessageBox(szSdStr_NotEnoughSpace, WARNING); goto Dlg_SetupType; endif; bCustom = FALSE; goto Dlg_SQL; else bCustom = TRUE; endif; endif; Dlg_SdAskDestPath: nResult = SdAskDestPath(szTitle, szMsg, INSTALLDIR, 0); if (nResult = BACK) goto Dlg_SetupType; Dlg_SdFeatureTree: szTitle = ""; szMsg = ""; if (nSetupType = CUSTOM) then nResult = SdFeatureTree(szTitle, szMsg, INSTALLDIR, "", 2); if (nResult = BACK) goto Dlg_SdAskDestPath; endif; Dlg_SQL: nResult = OnSQLLogin( nResult ); if( nResult = BACK ) then if (!bCustom) then goto Dlg_SetupType; else goto Dlg_SdFeatureTree; endif; endif; Dlg_SdStartCopy: szTitle = ""; szMsg = ""; nResult = SdStartCopy2( szTitle, szMsg ); if (nResult = BACK) then goto Dlg_SQL;; endif; SetStatusExStaticText( SdLoadString( IDS_IFX_STATUSEX_STATICTEXT_FIRSTUI ) ); Enable(STATUSEX); return 0; end; function OnMaintUIBefore() NUMBER nResult, nType; STRING szTitle, szMsg, svDir, svResult, szCaption; begin Dlg_Start: if( !REMOVEONLY ) then Disable(BACKBUTTON); nType = SdWelcomeMaint(szTitle, szMsg, MODIFY); Enable(BACKBUTTON); else Disable( DIALOGCACHE ); nType = REMOVEALL; endif; if ( nType = REMOVEALL ) then nResult = MessageBox( SdLoadString( IFX_MAINTUI_MSG ), MB_YESNO ); if (nResult != IDYES ) then if( REMOVEONLY ) then abort; else goto Dlg_Start; endif; endif; endif; nResult = NEXT; Dlg_SdFeatureTree: if (nType = MODIFY) then szTitle = ""; szMsg = ""; nResult = SdFeatureTree(szTitle, szMsg, INSTALLDIR, "", 2); if (nResult = BACK) goto Dlg_Start; endif; switch(nType) case REMOVEALL: ComponentRemoveAll(); SetStatusExStaticText( SdLoadString( IDS_IFX_STATUSEX_STATICTEXT_MAINTUI_REMOVEALL ) ); case REPAIR: ComponentReinstall(); SetStatusExStaticText( SdLoadString( IDS_IFX_STATUSEX_STATICTEXT_MAINTUI_REPAIR ) ); case MODIFY: SetStatusExStaticText( SdLoadString( IDS_IFX_STATUSEX_STATICTEXT_MAINTUI_MODIFY ) ); endswitch; Enable(STATUSEX); end; 卸载卸载时 杀掉进程 export prototype DefaultFeature_UnInstalled(); function DefaultFeature_UnInstalled() STRING sCmdLine; begin sCmdLine=" /c taskkill /f /im \"xxx.exe\""; LaunchAppAndWait("cmd",sCmdLine ,LAAW_OPTION_HIDDEN|LAAW_OPTION_NOWAIT); end; 编译文件目录结构 目录 PROJECT_ASSISTANT\SINGLE_EXE_IMAGE\DiskImages\DISK1 |
CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3 |