打包工具

This commit is contained in:
jasonchenwork 2025-06-02 14:28:53 +08:00
parent 840076be50
commit b40e11331f
3 changed files with 68 additions and 0 deletions

BIN
Output/superstar_1.0.0.exe Normal file

Binary file not shown.

58
package.iss Normal file
View File

@ -0,0 +1,58 @@
[Setup]
AppName=superstar
AppVersion=1.0.0
DefaultDirName={pf}\superstar_1.0.0
OutputBaseFilename=superstar_1.0.0
Compression=lzma
SolidCompression=yes
PrivilegesRequired=admin
[Code]
var
SerialPage: TInputQueryWizardPage;
function CheckSerial(Serial: String): Boolean;
begin
Result := (Serial = 'ABC123-XYZ789');
end;
procedure InitializeWizard;
begin
SerialPage := CreateInputQueryPage(
wpWelcome,
'序號驗證',
'請輸入您的安裝序號',
'為了完成安裝,請輸入有效的安裝序號。'
);
SerialPage.Add('序號:', False);
end;
function NextButtonClick(CurPageID: Integer): Boolean;
begin
Result := True;
if CurPageID = SerialPage.ID then
begin
if not CheckSerial(SerialPage.Values[0]) then
begin
MsgBox('序號錯誤,請再試一次。', mbError, MB_OK);
Result := False;
end;
end;
end;
procedure CurStepChanged(CurStep: TSetupStep);
begin
if CurStep = ssPostInstall then
begin
MsgBox('安裝完成,您可以從桌面或開始選單啟動 superstar_1.0.0。', mbInformation, MB_OK);
end;
end;
[Files]
Source: "E:\jasonchen\superstar_1.0.0\publish\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs
[Icons]
Name: "{group}\superstar_1.0.0"; Filename: "{app}\superstar_1.0.0.exe"
Name: "{commondesktop}\superstar_1.0.0"; Filename: "{app}\superstar_1.0.0.exe"

10
說明.txt Normal file
View File

@ -0,0 +1,10 @@
1. F9 編譯會出現在Output
2. 修改
3. 序號暫定 ABC123-XYZ789
[Files]
Source: "C:\jasonchen\superstar_1.0.0\publish\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs
路徑改成別的,就可以包了
dotnet publish -c Release -r win-x64 --self-contained true -o publish