【问题标题】:inno setup activating using a licence key file使用许可证密钥文件激活 inno setup
【发布时间】:2014-11-23 06:59:23
【问题描述】:

如果可能的话,我需要一些帮助吗?有没有什么方法可以代替使用序列名,而是使用可以是 txt、DAT 或 BIN 文件的许可证密钥文件,以继续安装您的产品。

有一个解决方案,称为:VMPKit for Inno Setup,但价格昂贵。

这里是a link

希望大家能帮帮我,提前谢谢朋友们。

【问题讨论】:

    标签: inno-setup


    【解决方案1】:

    您需要创建一个自定义向导页面,并调用您自己的函数来激活您的应用。这很简单,但(以我的方式)它还需要调用你的 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 很不错

    【讨论】:

      猜你喜欢
      • 2011-05-08
      • 2017-06-12
      • 2011-12-07
      • 1970-01-01
      • 2011-02-02
      • 2018-09-01
      • 2012-11-08
      • 2022-11-02
      • 2011-08-11
      相关资源
      最近更新 更多