# aldric2023/microsoft-office-2021 architecture

> Architecture diagram of the GitHub repository aldric2023/microsoft-office-2021, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/aldric2023/microsoft-office-2021
- Repository: https://github.com/aldric2023/microsoft-office-2021

## Overview

##### Project Type and Purpose
- This is a script-based automation tool. It packages Office2021.zip (Office Deployment Tool + installation files) and helper batch scripts for both installation and license activation.
- Users download, extract, run install scripts, then activate Office via built-in command-line tools (ospp.vbs) pointing at an external KMS server.

##### Main Components
a. Local Client Environment
– Windows OS (Win10 or later)
– File system (where Office2021.zip is extracted)
– Command Prompt / PowerShell
b. Office Deployment Package
– Office2021.zip
– Install-x32.bat / Install-x64.bat (full install)
– Install-x32-basic.bat / Install-x64-basic.bat (core apps only)
c. Activation Scripts
– Activator.bat (wraps ospp.vbs commands)
– Direct command-line invocation of ospp.vbs for manual activation
d. External Service
– KMS Host (kms.msgang.com) where activation requests are directed

##### Relationships & Data Flows
1. User downloads Office2021.zip → Extracts to local folder
2. User runs one of the Install-*.bat scripts →
- Batch script invokes Office Deployment Tool (configuration inside zip) →
- Windows Installer fetches Office binaries →
- Office apps are installed locally
3. User triggers activation (either via Activator.bat or manual cmd lines) →
- ospp.vbs scripts read local license files, install key →
- ospp.vbs sets KMS host →
- ospp.vbs sends activation request over network to kms.msgang.com →
- Receives activation response →
- Local Office license state is updated

##### Architectural Patterns & Principles
- Single-Machine Automation: All steps occur on the same client machine.
- Script-driven Workflow: Separation between “Install” phase and “Activate” phase.
- External Dependency: Activation via remote KMS service.

##### Detailed Capture
– Break the local environment into “File System” and “Command Shell.”
– Annotate how Install-basic differs (only Word/Excel/PPT).
– Show fallback checks in scripts (“if exist … cd /d …”).
– Call out ospp.vbs commands: /inslic, /inpkey, /sethst, /act.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% User Environment
    User["User\n(Windows OS)"]:::local

    subgraph "Local Client"
        direction TB
        subgraph "File System"
            direction TB
            Zip["Office2021.zip"]:::package
            README["README.md"]:::docs
            LICENSE["LICENSE"]:::docs
            OfficeApps["Office Apps Installed"]:::local
        end
        subgraph "Command Shell"
            direction TB
            InstallBatch["Install-*.bat\n(Install Scripts)"]:::script
            ActivationBatch["Activator.bat\n(Activation Scripts)"]:::script
            ManualCmd["Manual ospp.vbs Commands"]:::script
            Ospp["ospp.vbs"]:::script
        end
    end

    KMS["KMS Host\nkms.msgang.com"]:::external

    %% Flows
    User -->|"downloads & extracts"| Zip
    Zip -->|"contains scripts & ODT"| InstallBatch
    InstallBatch -->|"invokes ODT & Windows Installer"| OfficeApps

    ActivationBatch -->|"calls ospp.vbs"| Ospp
    ManualCmd -->|"calls ospp.vbs"| Ospp
    Ospp -->|"/sethst & /act"| KMS
    KMS -->|"activation response"| Ospp
    Ospp -->|"updates license"| OfficeApps

    %% Documentation Links
    User -.-> README
    User -.-> LICENSE

    %% Click Events
    click Zip "https://github.com/aldric2023/microsoft-office-2021/blob/main//Office2021.zip"
    click README "https://github.com/aldric2023/microsoft-office-2021/blob/main/README.md"
    click LICENSE "https://github.com/aldric2023/microsoft-office-2021/tree/main/LICENSE"

    %% Styles
    classDef local fill:#D6EAF8,stroke:#5DADE2,stroke-width:1px;
    classDef package fill:#D5F5E3,stroke:#27AE60,stroke-width:1px;
    classDef script fill:#AED6F1,stroke:#3498DB,stroke-width:1px;
    classDef external fill:#FAD7A0,stroke:#EB984E,stroke-width:1px;
    classDef docs fill:#F5CBA7,stroke:#D35400,stroke-width:1px;
```
