有一个解决方案,称为:Inno Setup的VMPKit,但价格昂贵。
这是a link!
我希望你们能帮助我,提前谢谢你的朋友们。
答案 0 :(得分:0)
您需要创建自定义向导页面,并调用您自己的功能来激活您的应用程序。这是一个简单而简单的方法,但(以我的方式)它也需要调用你的dll来激活应用程序。
我在尝试创建这样的“激活”设置页面时失去了一些时间,但很快就发现它已经浪费了我的时间。目前我使用VMProtect Ultimate和VMP Web许可证管理器,并使用vmpkit将其集成到我的应用程序中。很抱歉我为商业软件道歉,但我认为值得。
使用VMPKit的Inno安装脚本如下所示:
[Code]
var
ChoiceUserGroupPage : TInputOptionWizardPage;
ActivationType: Integer;
VmpikAppIsActivatedFlag : Boolean;
var
VMPIK_SERIAL_FORMAT: array of integer; // see function InitializeSerialFormat and InitializeWizard
VMPIK_SERIAL_NUM_PARTS: integer; // = 10;
const
VMPIK_SERIAL_NUM_PARTS_MAX = 16;
VMPIK_ACTIVATE_CHOICE_ALLOW_SERIAL = True; // Change to your own value
VMPIK_ACTIVATE_CHOICE_ALLOW_LICENSE_KEY_FILE = True; // Change to your own value True
VMPIK_ACTIVATE_CHOICE_ALLOW_TRIAL = True;
VMPIK_ACTIVATE_CHOICE_ALLOW_LATER = True; // Change to your own value
VMPIK_ACTIVATE_CHOICE_ALLOW_ALREADY = True; // Change to your own value
VMPIK_TRIAL_SERIAL_NUMBER = '{#TRIAL_SERIAL}'; //'XXXX-XXXX-XXXX-XXXX'; // Change to your own value or keep empty if VMPIK_ACTIVATE_CHOICE_ALLOW_TRIAL = False
VMPIK_ACTIVATION_LOG_ALLOW = True; // allow log activation process and /ACTIVATIONLOG command line switch
VMPIK_ACTIVATION_LOG_FILENAME_PREFIX = 'clp_'; // prefix for activation log filename
var
ActivateChoicePage: TInputOptionWizardPage;
EnterSerialNumberPage: TWizardPage;
ChoiceKeyFilePage: TInputFileWizardPage;
#include "select_grp_scrip.pas"
#include "activate_hlp_script.pas"
procedure InitializeSerialFormat(var fmt:Array of integer);
begin
SetArrayLength(fmt,VMPIK_SERIAL_NUM_PARTS_MAX);
VMPIK_SERIAL_NUM_PARTS := 4;
fmt[0] := 4; fmt[1] := 4; fmt[2] := 4; fmt[3] := 4;
fmt[4] := 0; fmt[5] := 0; fmt[6] := 0; fmt[7] := 0;
fmt[8] := 0; fmt[9] := 0; fmt[10] := 0; fmt[11] := 0;
fmt[12] := 0; fmt[13] := 0; fmt[14] := 0; fmt[15] := 0;
end;
function ShouldSkipPage(PageID: Integer): Boolean;
begin
Result := False;
if ((PageID=ChoiceUserGroupPage.ID) and ((gsSkipPage<>False) or WizardSilent() )) then
begin
TestUserGroupChoice(ChoiceUserGroupPage);
Result := True;
Exit;
end;
if (PageID=ActivateChoicePage.ID) then
begin
if (VMPIK_IsNeedToSkipChoiceActivationTypePage() = True) then Result := True;
Exit;
end;
if (PageID = EnterSerialNumberPage.ID) then
begin
if (VMPIK_IsNeedToSkipSerialPage(ActivationType) = True) then Result := True;
Exit;
end;
if (PageID = ChoiceKeyFilePage.ID) then
begin
if (VMPIK_IsNeedToSkipLicenseKeyFilePage(ActivationType) = True) then Result := True;
Exit;
end;
end;
function NextButtonClick(CurPageID: Integer): Boolean;
begin
Result := True;
if (CurPageID=ChoiceUserGroupPage.ID) then
begin
TestUserGroupChoice(ChoiceUserGroupPage);
Exit;
end;
if (CurPageID=ActivateChoicePage.ID) then
begin
ActivationType := VMPIK_GetActivationTypeCode(ActivateChoicePage);
end;
if ((CurPageID=ActivateChoicePage.ID) and ((ActivationType=AM_LATER) or (ActivationType=AM_ALREADY))) then
begin
Exit;
end;
if (((CurPageID=ActivateChoicePage.ID) and (ActivationType=AM_TRIAL)) or
((CurPageID=ChoiceKeyFilePage.ID) and (ActivationType=AM_LICFILE)) or
((CurPageID=EnterSerialNumberPage.ID) and (ActivationType=AM_SERIAL)) or
((CurPageID=wpReady) and (VmpikCommandLineSkipActivationPages<>False)) // silent activation runs immediately before install
) then
begin
Result := VMPIK_OnNextButtonClick_TryActivate( CurPageID
, VMPIK_ACF_SHARE64FOR32KEY
, 'Software\' + '{#APP_REG_KEY}'
, 'License'
, 'SerialNumber'
, 'Trial'
, 'http://vmpkit.com/'
, ChoiceKeyFilePage.Values[0]
);
Exit;
end;
end;
procedure InitializeWizard ();
var
numParams : Integer;
paramNo : Integer;
StrParamName: string;
StrParamVal: string;
begin
VmpikAppIsActivatedFlag := False;
InitializeSerialFormat(VMPIK_SERIAL_FORMAT);
ChoiceUserGroupPage := CreateChoiceUserGroupPage(wpLicense);
ActivateChoicePage := VMPIK_CreateChoiceActivationPage(wpSelectTasks); // wpWelcome, wpInfoBefore
EnterSerialNumberPage := VMPIK_CreateEnterSerialNumberPage(ActivateChoicePage.ID);
ChoiceKeyFilePage := VMPIK_CreateChoiceKeyFilePage(EnterSerialNumberPage.ID);
GrpParseCommandLine( ChoiceUserGroupPage );
VMPIK_ParseCommandLine( ActivateChoicePage, EnterSerialNumberPage );
end;
上面的脚本显示“选择用户”页面 - 全部安装或仅为当前用户安装,然后显示激活页面。
此外,VMPKit Inno安装脚本支持非常静默的设置 - 您可以在命令行中设置序列号以进行无人参与安装。
我发现VMPKit很不错