diff --git a/.cmake/InstallerScript.iss.in b/.cmake/InstallerScript.iss.in new file mode 100644 index 00000000..8768f430 --- /dev/null +++ b/.cmake/InstallerScript.iss.in @@ -0,0 +1,49 @@ +; Script generated by the Inno Setup Script Wizard. +; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES! + +#define MyAppName "example" +#define MyAppVersion "${GIT_SEMVER}" +#define MyAppPublisher "ZhuZiChu" +#define MyAppURL "https://zhuzichu520.github.io/" +#define MyAppExeName "example.exe" +#define MyAppFileDir "example-win64_msvc2019_64-6.5.0" + +[Setup] +; NOTE: The value of AppId uniquely identifies this application. Do not use the same AppId value in installers for other applications. +; (To generate a new GUID, click Tools | Generate GUID inside the IDE.) +AppId={{A053D1AE-AEA9-4105-A79B-B5F5BEDC9208} +AppName={#MyAppName} +AppVersion={#MyAppVersion} +;AppVerName={#MyAppName} {#MyAppVersion} +AppPublisher={#MyAppPublisher} +AppPublisherURL={#MyAppURL} +AppSupportURL={#MyAppURL} +AppUpdatesURL={#MyAppURL} +DefaultDirName={autopf}\{#MyAppName} +DisableProgramGroupPage=yes +; Uncomment the following line to run in non administrative install mode (install for current user only.) +;PrivilegesRequired=lowest +OutputDir=.\ +OutputBaseFilename=installer +Compression=lzma +SolidCompression=yes +WizardStyle=modern + +[Languages] +Name: "chinesesimplified"; MessagesFile: "compiler:Languages\ChineseSimplified.isl" + +[Tasks] +Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: checkablealone + +[Files] +Source: ".\..\{#MyAppFileDir}\{#MyAppExeName}"; DestDir: "{app}"; Flags: ignoreversion +Source: ".\..\{#MyAppFileDir}\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs +; NOTE: Don't use "Flags: ignoreversion" on any shared system files + +[Icons] +Name: "{autoprograms}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}" +Name: "{autodesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon + +[Run] +Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent + diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index ef676d36..3f59540b 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -76,12 +76,18 @@ jobs: name: ${{ steps.package.outputs.packageName }} path: ${{ steps.package.outputs.packageName }} + - name: inno setup install + if: startsWith(github.event.ref, 'refs/tags/') + uses: zhuzichu520/inno-setup-action@v1.0.0 + with: + filepath: ./action-cli/InstallerScript.iss + - name: uploadRelease if: startsWith(github.event.ref, 'refs/tags/') uses: svenstaro/upload-release-action@v2 with: repo_token: ${{ secrets.GITHUB_TOKEN }} - file: ${{ steps.package.outputs.packageName }}.zip - asset_name: ${{ env.fileName }}_${{ github.ref_name }}_${{ matrix.qt_arch }}_Qt${{ matrix.qt_ver }}.zip + file: ./action-cli/installer.exe + asset_name: ${{ env.fileName }}_${{ github.ref_name }}_${{ matrix.qt_arch }}_Qt${{ matrix.qt_ver }}.exe tag: ${{ github.ref }} overwrite: true \ No newline at end of file diff --git a/.gitignore b/.gitignore index d1dd29a6..a8b15423 100644 --- a/.gitignore +++ b/.gitignore @@ -37,4 +37,6 @@ build cmake-build-* .idea -example/Version.h \ No newline at end of file +example/Version.h + +action-cli \ No newline at end of file diff --git a/example/CMakeLists.txt b/example/CMakeLists.txt index 72512675..70013d22 100644 --- a/example/CMakeLists.txt +++ b/example/CMakeLists.txt @@ -71,7 +71,7 @@ if(QT_VERSION VERSION_GREATER_EQUAL "6.2") endforeach(filepath) endif() -#如果是Windows平台,则生成rc文件 +#如果是Windows平台,则生成rc文件,还有inno setup脚本文件 set(EXAMPLE_VERSION_RC_PATH "") if(WIN32) set(EXAMPLE_VERSION_RC_PATH ${CMAKE_BINARY_DIR}/version_${PROJECT_NAME}.rc) @@ -79,6 +79,10 @@ if(WIN32) ${FLUENTUI_DIRECTORY}/.cmake/version_exe.rc.in ${EXAMPLE_VERSION_RC_PATH} ) + configure_file( + ${FLUENTUI_DIRECTORY}/.cmake/InstallerScript.iss.in + ${CMAKE_SOURCE_DIR}/action-cli/InstallerScript.iss + ) endif() #添加可执行文件