每个用户的序列号

时间:2017-07-11 10:57:56

标签: lua setup-factory

我正在尝试在Setup Factory中使用一次序列号。

这个想法如下:

当用户输入序列号时,我的安装程序将检查并前进到下一页(如果序列正确)..当它在插入序列号后将用户传递到下一页'那么该页必须有一个按钮称为“立即安装”

当按下按钮Install Now时,它将执行查询,首先从此列表中删除它,然后安装该应用程序。

  

问题是:如何删除序列号?

OnNext操作中的代码:

-- These actions are performed when the Next button is clicked.

-- get the serial number that the user entered
local strSerial = SessionVar.Expand("%SerialNumber%");


-- Trim leading and trailing spaces from the serial number.
strSerial = String.TrimLeft(strSerial);
strSerial = String.TrimRight(strSerial);
SessionVar.Set("%SerialNumber%", strSerial);


-- the name of the serial number list you want to use, e.g. "Serial List 1"
-- (use nil to search through all of the serial number lists)
local strListName = nil;

-- from _SUF70_Global_Functions.lua:
-- search through the specified serial number list for a match
local bSerialIsValid = g_IsSerialNumberInList(strSerial, strListName);

-- if the user entered a valid serial number, proceed to the next screen,
-- otherwise display an error message and check whether they have any retries left
if(bSerialIsValid) then

    -- advance to the next screen
    Screen.Next();

else

    -- user entered an invalid serial number

    SerialNumberScreen.AttemptCount = SerialNumberScreen.AttemptCount + 1;

    -- display an 'Invalid serial number' message
    Dialog.Message(SetupData.GetLocalizedString("MSG_ERROR"), SetupData.GetLocalizedString("ERR_INVALID_SERIAL"));

    -- if the user is out of retries, exit the application
    if(SerialNumberScreen.AttemptCount >= SerialNumberScreen.MaxAttempts) then
        Application.Exit(0);
    end

end
  • 您可以在此处生成序列号

enter image description here

我想从此列表中删除序列号。

  • 这是序列号屏幕的onNext操作和代码:

enter image description here

1 个答案:

答案 0 :(得分:2)

您无法编辑已发布设置的项目设置。序列号经过加密并嵌入到安装程序中,然后可以对设置进行数字签名。该文件无法在运行时编辑。