3
我想在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
- 在這裏,您可以生成序列號
我想從這個列表中刪除序列號。
- 這裏是序列號屏幕和代碼onNext行動: