C# 如何在installscript中的单个安装文件中添加两种安装类型
我将InstallShield 2013用于部署包,我想在单个安装文件中添加两种安装类型(两个应用程序)。我的意思是,用户应该能够在installShield上运行安装文件时选择要安装的应用程序 背景 在我的安装文件中,有两个应用程序作为控制台和查看器。用户可以选择他/她想要的应用程序,但所选应用程序的进一步安装不起作用。需要帮助 这是我的代码。C# 如何在installscript中的单个安装文件中添加两种安装类型,c#,.net,installshield,installscript,C#,.net,Installshield,Installscript,我将InstallShield 2013用于部署包,我想在单个安装文件中添加两种安装类型(两个应用程序)。我的意思是,用户应该能够在installShield上运行安装文件时选择要安装的应用程序 背景 在我的安装文件中,有两个应用程序作为控制台和查看器。用户可以选择他/她想要的应用程序,但所选应用程序的进一步安装不起作用。需要帮助 这是我的代码。 function OnFirstUIBefore() NUMBER nResult, nType; STRING szT
function OnFirstUIBefore()
NUMBER nResult, nType;
STRING szTitle, szMsg, svResult, szCaption;
NUMBER nSetupType, nvSize, nUser, nReserved;
STRING szQuestion, svName, svCompany, szFile, szLicense;
STRING szLicenseFile,szReserved, svSetupType;
LIST list, listStartCopy;
BOOL bCustom, bCopy, bDontCopy;
begin
MessageBox("OnFirstUIBefore()",0);
SHELL_OBJECT_FOLDER = @PRODUCT_NAME;
nSetupType = CUSTOM;
bCopy = FALSE ;
bDontCopy = TRUE ;
bCustom = TRUE;
szLicense = SUPPORTDIR^ "AbcTerms.rtf";
Dlg_SdWelcome:
szTitle = "";
szMsg = "";
nResult = SdWelcome(szTitle, szMsg);
if (nResult = BACK) goto Dlg_SdWelcome;
szTitle = "";
svName = "";
svCompany = "";
Dlg_SdLicense:
nResult = SdLicense2Rtf ( "","" , "", szLicense , FALSE );
if(nResult = BACK) goto Dlg_SdWelcome;
Dlg_SdCustomerInformation:
nResult = SdCustomerInformation(szTitle, svName, svCompany, nUser);
if (nResult = BACK) goto Dlg_SdLicense;
Dlg_SetupType:
szTitle = "Please select installation type";
szMsg = "";
szReserved = "";
svSetupType = "Viewer";
nReserved = 0;
nResult = SdSetupTypeEx(szTitle, szMsg, szReserved, svSetupType, nReserved);
INSTALLTYPE = svSetupType; //"Console";//
if(svSetupType == "Console") then
MsiSetProperty( ISMSI_HANDLE, "DOCUSTOMEACTION" , 'copy' );
MsiSetProperty( ISMSI_HANDLE, "INSTALLMODE" , "ConsoleV3");//"1:3"
else
MsiSetProperty( ISMSI_HANDLE, "INSTALLMODE" , "ViewerV3" ); //"1:2"
endif;
MsiSetProperty( ISMSI_HANDLE, "SOURCEPATH" , SourceDir );
if (nResult = BACK) goto Dlg_SdCustomerInformation;
Dlg_SdAskDestPath:
nResult = SdAskDestPath(szTitle, szMsg, INSTALLDIR, 0);
if (nResult = BACK) goto Dlg_SetupType;
Enable(STATUSEX);
return 0; end;
编辑的代码
function OnFirstUIBefore()
NUMBER nResult, nType;
STRING szTitle, szMsg, svResult, szCaption;
NUMBER nSetupType, nvSize, nUser, nReserved;
STRING szQuestion, svName, svCompany, szFile, szLicense;
STRING szLicenseFile,szReserved, svSetupType;
LIST list, listStartCopy;
BOOL bCustom, bCopy, bDontCopy;
begin
MessageBox("OnFirstUIBefore()",0);
SHELL_OBJECT_FOLDER = @PRODUCT_NAME;
nSetupType = CUSTOM;
bCopy = FALSE ;
bDontCopy = TRUE ;
bCustom = TRUE;
szLicense = SUPPORTDIR^ "AbcTerms.rtf";
Dlg_SdWelcome:
szTitle = "";
szMsg = "";
nResult = SdWelcome(szTitle, szMsg);
if (nResult = BACK) goto Dlg_SdWelcome;
szTitle = "";
svName = "";
svCompany = "";
Dlg_SdLicense:
nResult = SdLicense2Rtf ( "","" , "", szLicense , FALSE );
if(nResult = BACK) goto Dlg_SdWelcome;
Dlg_SdCustomerInformation:
nResult = SdCustomerInformation(szTitle, svName, svCompany, nUser);
if (nResult = BACK) goto Dlg_SdLicense;
Dlg_SetupType:
szTitle = "Please select installation type";
szMsg = "";
szReserved = "";
svSetupType = "Viewer";
nReserved = 0;
nResult = SdSetupTypeEx(szTitle, szMsg, szReserved, svSetupType, nReserved);
INSTALLTYPE = svSetupType; //"Console";//
MsiSetProperty( ISMSI_HANDLE, "DOCUSTOMEACTION" , 'copy' );
if(svSetupType == "Console") then
MsiSetProperty( ISMSI_HANDLE, "INSTALLMODE" , "ConsoleV3");//"1:3"
else
MsiSetProperty( ISMSI_HANDLE, "INSTALLMODE" , "ViewerV3" ); //"1:2"
endif;
MsiSetProperty( ISMSI_HANDLE, "SOURCEPATH" , SourceDir );
if (nResult = BACK) goto Dlg_SdCustomerInformation;
Dlg_SdAskDestPath:
nResult = SdAskDestPath(szTitle, szMsg, INSTALLDIR, 0);
if (nResult = BACK) goto Dlg_SetupType;
Enable(STATUSEX);
return 0; end;
这个很好用
function OnFirstUIBefore()
NUMBER nResult, nType;
STRING szTitle, szMsg, svResult, szCaption;
NUMBER nSetupType, nvSize, nUser, nReserved;
STRING szQuestion, svName, svCompany, szFile, szLicense;
STRING szLicenseFile,szReserved, svSetupType;
LIST list, listStartCopy;
BOOL bCustom, bCopy, bDontCopy;
begin
MessageBox("OnFirstUIBefore()",0);
SHELL_OBJECT_FOLDER = @PRODUCT_NAME;
nSetupType = CUSTOM;
bCopy = FALSE ;
bDontCopy = TRUE ;
bCustom = TRUE;
szLicense = SUPPORTDIR^ "AbcTerms.rtf";
Dlg_SdWelcome:
szTitle = "";
szMsg = "";
nResult = SdWelcome(szTitle, szMsg);
if (nResult = BACK) goto Dlg_SdWelcome;
szTitle = "";
svName = "";
svCompany = "";
Dlg_SdLicense:
nResult = SdLicense2Rtf ( "","" , "", szLicense , FALSE );
if(nResult = BACK) goto Dlg_SdWelcome;
Dlg_SdCustomerInformation:
nResult = SdCustomerInformation(szTitle, svName, svCompany, nUser);
if (nResult = BACK) goto Dlg_SdLicense;
Dlg_SetupType:
szTitle = "Please select installation type";
szMsg = "";
szReserved = "";
svSetupType = "Viewer";
nReserved = 0;
nResult = SdSetupTypeEx(szTitle, szMsg, szReserved, svSetupType, nReserved);
INSTALLTYPE = svSetupType; //"Console";//
MsiSetProperty( ISMSI_HANDLE, "DOCUSTOMEACTION" , 'copy' );
if(svSetupType == "Console") then
MsiSetProperty( ISMSI_HANDLE, "INSTALLMODE" , "ConsoleV3");//"1:3"
else
MsiSetProperty( ISMSI_HANDLE, "INSTALLMODE" , "ViewerV3" ); //"1:2"
endif;
MsiSetProperty( ISMSI_HANDLE, "SOURCEPATH" , SourceDir );
if (nResult = BACK) goto Dlg_SdCustomerInformation;
Dlg_SdAskDestPath:
nResult = SdAskDestPath(szTitle, szMsg, INSTALLDIR, 0);
if (nResult = BACK) goto Dlg_SetupType;
Enable(STATUSEX);
return 0; end;
为了理解您想要做的事情,我有一些问题:您的项目是InstallScript MSI类型的,对吗?您希望从InstallShield项目中得到什么结果?msi软件包或InstallShield Setup.exe?你的两个包裹是什么?msi文件?这是一个InstallShield Setup.exe项目。它甚至包括InstallScript部分。有两种设置设计作为查看器和控制台。用户应该能够选择所需的应用程序(安装设计),安装过程也应该如此。@LucasF,编辑的代码工作正常。对您有好处。控制台模式也适用于旧代码?所以你必须做
MsiSetProperty(ISMSI_句柄,“DOCUSTOMEACTION”,“copy”)代码>适用于两种安装模式。是。如果有多个设置类型,则MsiSetProperty(ISMSI_句柄,“DOCUSTOMEACTION”,“copy”);你应该先跑。然后,任何安装类型的进一步安装都非常有效。