请问在用installshield打包程序时如何制作序列号?(300分)

  • 主题发起人 主题发起人 songyang
  • 开始时间 开始时间
S

songyang

Unregistered / Unconfirmed
GUEST, unregistred user!
installshield打包程序时如何制作安装序列号?最好有例子,全分送上!
 
仔细看看,或许对你有点帮助。不知道你的序列号是要动态生成还是固定在程序中

////////////////////////////////////////////////////////////////////////////////
//
// File Name: Setup.rul
//
// Description: InstallShield script
//
// Comments: This script was generated based on the selections you made in
// the Project Wizard. Refer to the help topic entitled "Modify
// the script that the Project Wizard generates"
for information
// on possible next steps.
//
////////////////////////////////////////////////////////////////////////////////

// Include header files

#include "
ifx.h"

////////////////////// string defines ////////////////////////////
//////////////////// installation declarations ///////////////////
// ----- DLL function prototypes -----

// your DLL function prototypes

// ---- script function prototypes -----

// your script function prototypes
// your global variables

//////////////////////////////////////////////////////////////////////////////
//
// FUNCTION: OnFirstUIBefore
//
// EVENT: FirstUIBefore event is sent when installation is run for the first
// time on given machine. In the handler installation usually displays
// UI allowing end user to specify installation parameters. After this
// function returns, ComponentTransferData is called to perform file
// transfer.
//
///////////////////////////////////////////////////////////////////////////////
function OnFirstUIBefore()
number nResult,nSetupType;
string szTitle, szMsg;
string szLicenseFile, szQuestion;
string szName, szCompany, szSerial;
string szTargetPath;
string szDir;
string szfolder;
string szComponents, szTargetdir;
number nLevel;
LIST listStartCopy;
number nvSize;
begin

// TOdo
: if you want to enable background, window title, and caption bar title
// SetTitle( @TITLE_MAIN, 24, WHITE );

SetTitle( '博思医药之星 安装[连锁版]', 0, BACKGROUNDCAPTION );

// Enable( FULLWINDOWMODE );
// Enable( BACKGROUND );
// SetColor(BACKGROUND,RGB (0, 128, 128));

nSetupType = TYPICAL;
TARGETDIR = PROGRAMFILES ^@COMPANY_NAME ^@PRODUCT_NAME;
szName = "博思企业管理软件顾问有限公司";
szCompany = "博思软件";
szSerial = "123456";

szDir = TARGETDIR;
SHELL_OBJECT_FOLDER = @FOLDER_NAME;
Dlg_Start:
// begin
ning of dialogs label
Dlg_SdWelcome:
szTitle = "博思医药之星[连锁版] 安装程序";
szMsg = "安装程序将在您的计算机中安装 博思医药之星 若要继续,请按下一步,否则按取消退出。";
nResult = SdWelcome( szTitle, szMsg );
if (nResult = BACK) goto Dlg_Start;
Dlg_SdLicense:
szLicenseFile = SUPPORTDIR ^ "license.txt";
szTitle = "博思医药之星[连锁版]/n请您在安装之前仔细阅读最终用户软件许可协议";

szMsg = "";
szQuestion = "";
nResult = SdLicense( szTitle, szMsg, szQuestion, szLicenseFile );
if (nResult = BACK) goto Dlg_SdWelcome;

Dlg_SdAskDestPath:
szTitle = "";
szMsg = "";
nResult = SdAskDestPath( szTitle, szMsg, szDir, 0 );
TARGETDIR = szDir;
if (nResult = BACK) goto Dlg_SdLicense;

Dlg_SetupType:
szTitle = "";
szMsg = "";
nResult = SetupType ( szTitle , szMsg , ""
, nSetupType , 0 );
if (nResult = BACK) then
goto Dlg_SdAskDestPath;
else
nSetupType = nResult;
if (nSetupType != CUSTOM) then
szTargetPath = TARGETDIR;
nvSize = 0;
ComponentCompareSizeRequired(MEDIA,szTargetPath,nvSize);
if (nvSize != 0) then

MessageBox( szSdStr_NotEnoughSpace, WARNING );
goto Dlg_SetupType;
endif;
endif;

endif;
Dlg_SdComponentTree:
if ((nResult = BACK) && (nSetupType != CUSTOM)) goto Dlg_SetupType;
szTitle = "";
szMsg = "";
szTargetdir = TARGETDIR;
szComponents = "";
nLevel = 2;
if (nSetupType = CUSTOM) then
nResult = SdComponentTree(szTitle, szMsg, szTargetdir, szComponents, nLevel);
if (nResult = BACK) goto Dlg_SetupType;

endif;
Dlg_ObjDialogs:
nResult = ShowObjWizardPages(nResult);
if (nResult = BACK) goto Dlg_SdComponentTree;

Dlg_SdSelectFolder:
szfolder = SHELL_OBJECT_FOLDER;
szTitle = "";
szMsg = "";
nResult = SdSelectFolder( szTitle, szMsg, szfolder );
SHELL_OBJECT_FOLDER = szfolder;
if (nResult = BACK) goto Dlg_ObjDialogs;

Dlg_SdStartCopy:
szTitle = "";
szMsg = "";
listStartCopy = ListCreate( STRINGLIST );
//The following is an example of how to add a string(szName) to a list(listStartCopy).
//eg. ListAddString(listStartCopy,szName,AFTER);
//nResult = SdStartCopy( szTitle, szMsg, listStartCopy );
//ListDestroy(listStartCopy);
//if (nResult = BACK) goto Dlg_SdSelectFolder;
// setup default status
SetStatusWindow(0, "");
Enable(STATUSEX);
StatusUpdate(ON, 100);
return 0;
end;

///////////////////////////////////////////////////////////////////////////////
//
// FUNCTION: OnMoving
//
// EVENT: Moving event is sent when file transfer is started as a result of
// ComponentTransferData call, before any file transfer operations
// are performed.
//
///////////////////////////////////////////////////////////////////////////////
function OnMoving()
string szAppPath;
begin
// Set LOGO Compliance Application Path
// TOdo
: if your application .exe is in a subfolder of TARGETDIR then
add subfolder
szAppPath = TARGETDIR;
RegDBSetItem(REGDB_APPPATH, szAppPath);
RegDBSetItem(REGDB_APPPATH_DEFAULT, szAppPath ^ @PRODUCT_KEY);
end;

// --- include script file section ---
 
我的意思是在安装程序时出现输入序列号窗口,然后输入设定的序列号正确后继续安装即可。
 
installshield express中验证序列号时需要一个dll文件,这个文件应该怎么做?通过这个dll文件就可以设置和验证序列号了。
 

Similar threads

D
回复
0
查看
753
DelphiTeacher的专栏
D
D
回复
0
查看
659
DelphiTeacher的专栏
D
后退
顶部