Skip to content

Tùy chỉnh sâu (Customization Deep Dive)

Beyond Preferences dialog — tùy chỉnh DVDAddin qua registry, file config, environment variables.

Registry tree đầy đủ

DVDAddin lưu settings ở:

HKCU\Software\DVD\DVDAddin\
├── API Keys\
│   ├── ChatGPTAPI         (REG_SZ — OpenAI key)
│   ├── GeminiAPI          (REG_SZ — Gemini key)
│   ├── GroqAPI            (REG_SZ)
│   └── CerebrasAPI        (REG_SZ)
├── Model\
│   ├── ModelChatGPT       (REG_SZ — vd: "gpt-4o-mini")
│   ├── ModelGemini        (REG_SZ — vd: "gemini-2.5-flash")
│   ├── ModelGroq          (REG_SZ)
│   └── ModelCerebras      (REG_SZ)
├── Temperature\
│   ├── ParamsChatGPT      (REG_SZ — vd: "0.7")
│   └── ParamsGemini       (REG_SZ — vd: "0.5")
├── Service\
│   └── ChatGPTService     (REG_SZ — "OpenAI" | "Groq" | "Cerebras")
├── Preferences\
│   ├── UILanguage         (REG_SZ — "vi" | "en")
│   ├── TargetLanguage     (REG_SZ — vd: "Vietnamese")
│   ├── OpResult           (REG_SZ — "Option1" | "Option2" | "Option3")
│   ├── OpTranslate        (REG_SZ — "Google" | "Gemini" | "ChatGPT")
│   ├── AutoCheckUpdate    (REG_DWORD — 0/1)
│   ├── Telemetry          (REG_DWORD — 0/1)
│   ├── PictureClickHandler (REG_DWORD — 0/1)
│   └── TxtAddSpace        (REG_SZ — autofit padding pt)
└── Licensing\
    ├── LastLicensedAtUtc  (REG_SZ — ISO 8601)
    ├── MaxSeenUtc         (REG_SZ — clock rollback anchor)
    └── TrialAnchorUtc     (REG_SZ — trial start timestamp)

Tùy chỉnh qua registry editor

Mở regedit

Win + Rregedit → Enter.

Đổi model AI manual (bypass Preferences UI)

Mặc định Gemini dùng gemini-2.5-flash. Đổi sang gemini-2.5-pro:

  1. Vào HKCU\Software\DVD\DVDAddin\Model.
  2. Right-click → Modify → ModelGemini = gemini-2.5-pro.
  3. Restart Excel.

Set API key qua command line

PowerShell script setup script cho team:

powershell
$key = 'Software\DVD\DVDAddin\API Keys'
Set-ItemProperty -Path "HKCU:$key" -Name 'GeminiAPI' -Value 'AIzaSy...your-key...'
Set-ItemProperty -Path "HKCU:$key" -Name 'ChatGPTAPI' -Value 'sk-...your-key...'

→ Triển khai cho team 10 máy không phải gõ tay từng máy.

Reset toàn bộ Preferences

powershell
Remove-Item -Path 'HKCU:Software\DVD\DVDAddin\Preferences' -Recurse -Force

→ DVDAddin sẽ dùng default values cho mọi setting. API keys + license vẫn giữ.

File config

License token

%LocalAppData%\DVDAddin\license.dat

Format binary: {json}|{hmac-hex}.

KHÔNG edit thủ công (HMAC verify sẽ fail). Backup file thì OK.

UI Language

%APPDATA%\DVDAddin\lang.txt

Content: vi hoặc en.

Có thể edit thủ công để override registry value.

Logs

%TEMP%\DVDAddin-AddIn*.log       (runtime addin logs)
%TEMP%\DVDAddin-AddIn64*.log     (64-bit variant)

Logs ghi mỗi lần Excel khởi động. Rotate khi > 10MB.

Cache

%LocalAppData%\DVDAddin\Cache\   (HTTP cache, temp files)

Safe to delete khi Excel đóng.

Environment variables

DVDAddin nhận một vài env var cho advanced config:

Env varMục đíchDefault
DVDADDIN_DEBUGVerbose loggingfalse
DVDADDIN_LICENSE_SERVEROverride URL serverhttps://dvdaddin-license-server.dangvandangdvd.workers.dev
DVDADDIN_OFFLINE_GRACE_DAYSOverride grace period1 (theo wrangler.toml server)
DVDADDIN_DISABLE_TELEMETRYForce tắt telemetryunset (= ON nếu user opt-in)
DVDADDIN_BUILDBuild number override(set bởi build script)

Set env var permanently

PowerShell:

powershell
[Environment]::SetEnvironmentVariable('DVDADDIN_DEBUG', 'true', 'User')

Restart Excel sau khi set.

Set tạm cho 1 session

powershell
$env:DVDADDIN_DEBUG = 'true'
& 'C:\Program Files\Microsoft Office\root\Office16\EXCEL.EXE'

→ Chỉ Excel mở từ shell này có DEBUG=true.

Custom AI models

Mặc định DVDAddin support 4 service (Google, Gemini, ChatGPT, Groq, Cerebras). Muốn thêm provider mới (vd: Anthropic Claude, Mistral, local Ollama):

Hiện tại

Chưa support qua UI. Workaround:

  1. Trong Preferences chọn ChatGPT → set:
    • Service = ChatGPT
    • Model = your-model-name
    • API key = key của provider mới
  2. Edit HKCU\Software\DVD\DVDAddin\Service\ChatGPTService = name riêng (vd: "Anthropic").

Tương lai (2.8.x)

Plan support OpenAI-compatible endpoint qua Preferences:

  • Custom base URL (vd: https://api.anthropic.com/v1).
  • Custom API key.
  • Custom model name.

Vote feature tại GitHub Discussions.

Custom Translate prompt

Mặc định DVDAddin dùng prompt được tune cho xây dựng VN (starter bar, lean concrete, ...). Muốn customize prompt cho ngành khác (y tế, IT, luật):

Hiện tại

Chưa expose qua UI. Workaround: tự fork source code, edit TranslationHelper.BuildPrompt(), build lại.

Tương lai (2.9.x)

Plan: cho phép user nhập custom prompt template trong Preferences.

Custom keyboard shortcuts

Excel KHÔNG cho customize shortcut của Ribbon button trực tiếp.

Workaround:

  1. Setup macro VBA gọi command:
    vba
    Sub MyTranslateShortcut()
        Application.OnKey "^+T"   ' Ctrl+Shift+T
        Application.Run "btnTranslate.OnAction"   ' chưa work cho .xll
    End Sub
  2. Hoặc dùng Auto Click record sequence + bind global hotkey.

Best approach: dùng KeyTip sẵn có (Alt + Y + ... — xem Cheatsheet).

Disable features bạn không dùng

Nếu không dùng AI / Translate / Connect Server:

Tắt auto-update

HKCU\Software\DVD\DVDAddin\Preferences\AutoCheckUpdate = 0.

Tắt telemetry

HKCU\Software\DVD\DVDAddin\Preferences\Telemetry = 0.

Tắt heartbeat license

Hiện tại heartbeat luôn chạy (4h/lần) — chống offline crack.

KHÔNG khuyến nghị tắt — license sẽ bị suspect.

Disable auto-detect Excel bitness in installer

Trong setup.exe, tự chạy với param:

cmd
setup.exe /v"EXCEL_BITNESS=x64"

→ Force install x64 path (skip auto-detect).

Group Policy deployment

Triển khai DVDAddin cho công ty 100+ máy:

Option A — MSI Group Policy

setup.exe chứa DVDAddin.msi bên trong. Extract:

cmd
setup.exe /e C:\Extracted

→ Có file DVDAddin.msi → import vào Group Policy → auto-deploy.

Option B — PowerShell script

Script chạy lúc boot:

powershell
$installer = '\\share\DVDAddin\setup.exe'
$argList = '/v"EXCEL_BITNESS=x64 /qb"'
Start-Process $installer -ArgumentList $argList -Wait

Option C — SCCM / Intune

Package setup.exe + uninstall command:

  • Install: setup.exe /v"/qb".
  • Uninstall: msiexec /x {ProductCode} /qb.

Deploy qua Microsoft Endpoint Configuration Manager hoặc Intune.

Multi-user shared license

Hiện tại license = 1 user / 1 machine. Multi-user shared license (vd: PC dùng chung trong văn phòng) chưa support tự nhiên.

Workaround:

  • Setup 1 license cho user "common" (vd: [email protected]).
  • Tất cả user trên PC đó login bằng credentials đó.
  • Trade-off: chỉ 1 session active cùng lúc → user mới login kick user cũ.

Solution chuẩn (tương lai): Floating license — N concurrent users từ pool license. Plan cho 2.9.x.

Liên quan

Released under DVDAddin License.