Giter VIP home page Giter VIP logo

nsis_ui's Introduction

nsis4j

forked from https://gitee.com/china_jeffery/nsis4j

  • 之前我们通过 NSIS 来包装成普通界面安装包,那我们在软件市场上看到那些靓丽的界面安装界面是怎么来的,基于Duilib的软件不完全列表

    公司 产品
    百度 PPS 爱奇艺 百度杀毒 百度卫士 91助手
    腾讯 微信 企业微信
    阿里 钉钉 支付宝安全控件 PP助手 优酷
    新东方 云教室RoomBox
    网易 易信 云音乐 荒野行动PC版
    华为 华为网盘
    金山 金山快盘
    京东 咚咚
    酷我 酷我音乐盒
    火绒 火绒安全软件
    墨迹风云 墨迹天气
  • 现在我们通过 NSISDuilib 来实现自定义安装界面

    • NSIS 用于实现安装逻辑
    • Duilib 用于实现UI界面
    • 通过NSIS调用 duilib 生成的dll库来实现
  • 生成安装包

  • NSISDialogDesigner 工具

    NSIS Dialog Designer is an IDE that provides a graphical tool to easily design your custom setup pages for the great NSIS installer system.

以上未经测试也没有制作自己的UI皮肤

  • 普通自定义页面

    !include nsDialogs.nsh
    !include LogicLib.nsh
    !include MUI2.nsh
    
    Name nsDialogs
    OutFile nsDialogs.exe
    RequestExecutionLevel user
    ShowInstDetails show
    
    Var Dialog
    Var TextUser
    Var TextPass
    Var TextDbName
    Var TextPgDir
    
    Page custom pgPageCreate pgPageLeave
    !insertmacro MUI_PAGE_INSTFILES
    
    !insertmacro MUI_LANGUAGE "English"
    
    Function pgPageCreate
        !insertmacro MUI_HEADER_TEXT "Database Settings" "Provide PostgreSQL config and install directory."
    
        nsDialogs::Create 1018
        Pop $Dialog
    
        ${If} $Dialog == error
            Abort
        ${EndIf}
    
        ${NSD_CreateGroupBox} 10% 10u 80% 62u "PostgreSQL Database Settings"
        Pop $0
    
            ${NSD_CreateLabel} 20% 26u 20% 10u "Username:"
            Pop $0
    
            ${NSD_CreateText} 40% 24u 40% 12u "postgres"
            Pop $TextUser
    
            ${NSD_CreateLabel} 20% 40u 20% 10u "Password:"
            Pop $0
    
            ${NSD_CreatePassword} 40% 38u 40% 12u ""
            Pop $TextPass
    
            ${NSD_CreateLabel} 20% 54u 20% 10u "New Database:"
            Pop $0
    
            ${NSD_CreateText} 40% 52u 40% 12u "mydb"
            Pop $TextDbName
    
        ${NSD_CreateGroupBox} 5% 86u 90% 34u "PostgreSQL Install Path"
        Pop $0
    
            ${NSD_CreateDirRequest} 15% 100u 49% 12u "$PROGRAMFILES64\PostgreSQL\10"
            Pop $TextPgDir
    
            ${NSD_CreateBrowseButton} 65% 100u 20% 12u "Browse..."
            Pop $0
            ${NSD_OnClick} $0 OnDirBrowse
    
        nsDialogs::Show
    FunctionEnd
    
    Function OnDirBrowse
        ${NSD_GetText} $TextPgDir $0
        nsDialogs::SelectFolderDialog "Select Postgres Directory" "$0"
        Pop $0
        ${If} $0 != error
            ${NSD_SetText} $TextPgDir "$0"
        ${EndIf}
    FunctionEnd
    
    Function PgPageLeave
        ${NSD_GetText} $TextUser $0
        ${NSD_GetText} $TextPass $1
        ${NSD_GetText} $TextDbName $2
        ${NSD_GetText} $TextPgDir $3
        MessageBox MB_OK "User: $0, Pass: $1, Db: $2, PgDir: $3"
    FunctionEnd
    
    Section
        DetailPrint "Hello, World!"
    SectionEnd

    自定义界面

nsis_ui's People

Contributors

nickeyme avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.