# arnobpl/symlinkcreator architecture

> Architecture diagram of the GitHub repository arnobpl/symlinkcreator, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-06-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/arnobpl/symlinkcreator
- Repository: https://github.com/arnobpl/symlinkcreator

## Overview

1. **Project type and runtime**
   - This is a **Windows desktop WPF application** written in **C#/.NET**.
   - Its purpose is narrow and tool-like: create **NTFS symbolic links** by generating and running a **`mklink`-based script**.
   - The app is explicitly Windows-only and depends on **administrative privileges** for symlink creation.

2. **Top-level structure**
   - The solution is split into three main areas:
     - **`core/`**: symlink creation logic and script execution
     - **`ui/`**: WPF windows, view model, and window-specific helpers
     - **`SymlinkCreatorTests/`**: unit tests for utility behavior
   - The root `App.xaml` / `App.xaml.cs` act as the WPF application entrypoint and bootstrap layer.

3. **User-facing application boundary**
   - The primary interaction surface is **`ui/mainWindow/MainWindow.xaml`** with its code-behind and **`MainWindowViewModel`**.
   - The main window is the orchestration point where the user supplies source paths, destination path, and options such as:
     - relative paths when possible
     - retaining generated script files
     - hiding successful operation dialogs
   - `ui/aboutWindow/` is a secondary informational window, not part of the core execution path.

4. **Core symlink workflow**
   - The central workflow is likely:
     1. collect selected file/folder sources from the UI
     2. validate and normalize paths
     3. build an executable script using `mklink`
     4. run the script
     5. report success or failure back to the UI
   - This flow is implemented across **`SymlinkAgent`**, **`ApplicationConfiguration`**, and **`ScriptExecutor`**.

5. **`core/SymlinkAgent.cs` as the domain coordinator**
   - This is the main domain service that appears to own **symlink generation logic**.
   - It likely decides how each source path maps to a destination path, whether the target is a file or directory, and whether a relative path can be used.
   - It is the best place to think of as the app’s **business-logic boundary** between UI inputs and OS-level execution.

6. **`core/ScriptExecutor.cs` as the OS execution boundary**
   - Script generation is not enough; the app must actually invoke the Windows command shell or command interpreter to run the script.
   - `ScriptExecutor` is the boundary that turns generated script content into an executed process.
   - This is also where failures from the OS layer would surface: privilege issues, invalid paths, long-path problems, or `mklink` errors.

7. **Configuration and behavior flags**
   - `core/ApplicationConfiguration.cs` suggests a small configuration model holding app-level options.
   - The README’s options map well to this configuration layer:
     - relative path preference
     - retain script file
     - suppress success dialogs
   - These options influence both the script content and the user feedback path.

8. **UI-to-core data flow**
   - The **ViewModel** is the main bridge between WPF controls and the core services.
   - The UI likely collects drag-and-drop input, binds it to observable state, and triggers symlink creation through commands.
   - This separates presentation concerns from execution concerns, with the ViewModel acting as the mediator.

9. **Windows-specific helpers**
   - `ui/utility/LongPathAware.cs` indicates the application is built with **long path support**, which is important because symlink targets and sources can exceed legacy path limits.
   - `NativeAdminShieldIcon.cs` and `WindowMaximizeButton.cs` are window chrome / shell integration helpers.
   - These are UI-adjacent, platform-specific pieces rather than core logic.

10. **Packaging and app identity**
    - `app.manifest`, `App.config`, and `packages.config` show a classic desktop packaging/runtime setup.
    - The manifest likely carries privilege and compatibility settings; the README explains the app needs elevation to create symlinks.
    - `FodyWeavers.xml` indicates build-time weaving/instrumentation is used, though it is not central to runtime architecture.

11. **Resources and static assets**
    - `resources/icons/` contains application icons and supporting visuals.
    - `_ReadMe/` stores screenshots and donation images used by the repository documentation and release presentation.
    - These assets affect presentation, not execution.

12. **Testing boundary**
    - `SymlinkCreatorTests/` contains focused unit tests, with `SymlinkUtilityTest.cs` suggesting validation around path/script utility behavior.
    - The tests likely target non-UI logic, which is the most stable place to verify behavior in a tool that depends heavily on filesystem rules.

13. **Architectural summary**
    - The app is essentially a **thin WPF shell** around a **Windows command-based symlink engine**.
    - The key architecture boundary is between:
      - **UI state and user interactions**
      - **core path/script generation**
      - **privileged external command execution**
    - When drawing the diagram, the most important arrows are: user input → ViewModel → core symlink agent/config → script executor → Windows shell / `mklink` → filesystem.

Main entry points: [`SymlinkCreator/ui/mainWindow/MainWindow.xaml.cs`](https://github.com/arnobpl/symlinkcreator/blob/main/SymlinkCreator/ui/mainWindow/MainWindow.xaml.cs) (Main code), [`SymlinkCreator/core/SymlinkAgent.cs`](https://github.com/arnobpl/symlinkcreator/blob/main/SymlinkCreator/core/SymlinkAgent.cs) (Symlink agent), [`SymlinkCreator/core/ScriptExecutor.cs`](https://github.com/arnobpl/symlinkcreator/blob/main/SymlinkCreator/core/ScriptExecutor.cs) (Script executor), [`SymlinkCreator/ui/mainWindow/MainWindow.xaml`](https://github.com/arnobpl/symlinkcreator/blob/main/SymlinkCreator/ui/mainWindow/MainWindow.xaml) (Main window)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_grp_root["Root"]
  node_node_app_xaml["App<br/>[App.xaml]"]
  node_node_app_cs["Bootstrap<br/>startup<br/>[App.xaml.cs]"]
  node_node_manifest["Manifest<br/>packaging<br/>[app.manifest]"]
  node_node_config["App config<br/>runtime config<br/>[App.config]"]
end

subgraph group_grp_core["Core"]
  node_node_appcfg["Settings<br/>configuration"]
  node_node_agent["Symlink agent<br/>domain service<br/>[SymlinkAgent.cs]"]
  node_node_exec["Script executor<br/>process boundary<br/>[ScriptExecutor.cs]"]
end

subgraph group_grp_ui["UI"]
  node_node_main_xaml["Main window<br/>wpf view<br/>[MainWindow.xaml]"]
  node_node_main_cs["Main code<br/>view code-behind<br/>[MainWindow.xaml.cs]"]
  node_node_vm["Main VM<br/>view model"]
  node_node_about_xaml["About window<br/>wpf view<br/>[AboutWindow.xaml]"]
  node_node_about_cs["About code<br/>view code-behind"]
  node_node_longpath["Long paths<br/>[LongPathAware.cs]"]
  node_node_adminshield["Admin shield"]
  node_node_maxbtn["Maximize btn"]
end

subgraph group_grp_tests["Tests"]
  node_node_tests["Symlink tests<br/>unit tests"]
end

subgraph group_grp_assets["Assets"]
  node_node_icons[("Icons<br/>assets")]
  node_node_readme[("Docs media<br/>assets")]
end

node_node_shell(("Windows shell<br/>external runtime"))
node_node_ntfs(("NTFS<br/>external filesystem"))

node_node_app_xaml -->|"starts"| node_node_app_cs
node_node_app_cs -->|"opens"| node_node_main_xaml
node_node_main_xaml -->|"backing"| node_node_main_cs
node_node_main_cs -->|"binds"| node_node_vm
node_node_vm -->|"reads"| node_node_appcfg
node_node_vm -->|"invokes"| node_node_agent
node_node_agent -->|"applies"| node_node_appcfg
node_node_agent -->|"hands off"| node_node_exec
node_node_exec -->|"runs in"| node_node_shell
node_node_shell -->|"creates links"| node_node_ntfs
node_node_main_cs -->|"opens"| node_node_about_xaml
node_node_about_xaml -->|"backing"| node_node_about_cs
node_node_main_cs -->|"uses"| node_node_longpath
node_node_main_cs -->|"uses"| node_node_adminshield
node_node_main_cs -->|"uses"| node_node_maxbtn
node_node_tests -->|"verifies"| node_node_agent
node_node_tests -->|"verifies"| node_node_exec
node_node_manifest -.->|"supports"| node_node_exec
node_node_icons -.->|"skins"| node_node_main_xaml
node_node_readme -.->|"documents"| node_node_main_xaml

click node_node_app_xaml "https://github.com/arnobpl/symlinkcreator/blob/main/SymlinkCreator/App.xaml"
click node_node_app_cs "https://github.com/arnobpl/symlinkcreator/blob/main/SymlinkCreator/App.xaml.cs"
click node_node_manifest "https://github.com/arnobpl/symlinkcreator/blob/main/SymlinkCreator/app.manifest"
click node_node_config "https://github.com/arnobpl/symlinkcreator/blob/main/SymlinkCreator/App.config"
click node_node_appcfg "https://github.com/arnobpl/symlinkcreator/blob/main/SymlinkCreator/core/ApplicationConfiguration.cs"
click node_node_agent "https://github.com/arnobpl/symlinkcreator/blob/main/SymlinkCreator/core/SymlinkAgent.cs"
click node_node_exec "https://github.com/arnobpl/symlinkcreator/blob/main/SymlinkCreator/core/ScriptExecutor.cs"
click node_node_main_xaml "https://github.com/arnobpl/symlinkcreator/blob/main/SymlinkCreator/ui/mainWindow/MainWindow.xaml"
click node_node_main_cs "https://github.com/arnobpl/symlinkcreator/blob/main/SymlinkCreator/ui/mainWindow/MainWindow.xaml.cs"
click node_node_vm "https://github.com/arnobpl/symlinkcreator/blob/main/SymlinkCreator/ui/mainWindow/MainWindowViewModel.cs"
click node_node_about_xaml "https://github.com/arnobpl/symlinkcreator/blob/main/SymlinkCreator/ui/aboutWindow/AboutWindow.xaml"
click node_node_about_cs "https://github.com/arnobpl/symlinkcreator/blob/main/SymlinkCreator/ui/aboutWindow/AboutWindow.xaml.cs"
click node_node_longpath "https://github.com/arnobpl/symlinkcreator/blob/main/SymlinkCreator/ui/utility/LongPathAware.cs"
click node_node_adminshield "https://github.com/arnobpl/symlinkcreator/blob/main/SymlinkCreator/ui/utility/NativeAdminShieldIcon.cs"
click node_node_maxbtn "https://github.com/arnobpl/symlinkcreator/blob/main/SymlinkCreator/ui/utility/WindowMaximizeButton.cs"
click node_node_tests "https://github.com/arnobpl/symlinkcreator/blob/main/SymlinkCreatorTests/SymlinkUtilityTest.cs"
click node_node_icons "https://github.com/arnobpl/symlinkcreator/tree/main/SymlinkCreator/resources/icons"
click node_node_readme "https://github.com/arnobpl/symlinkcreator/tree/main/SymlinkCreator/_ReadMe"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_node_app_xaml,node_node_app_cs,node_node_manifest,node_node_config toneBlue
class node_node_appcfg,node_node_agent,node_node_exec toneAmber
class node_node_main_xaml,node_node_main_cs,node_node_vm,node_node_about_xaml,node_node_about_cs,node_node_longpath,node_node_adminshield,node_node_maxbtn toneMint
class node_node_tests toneRose
class node_node_icons,node_node_readme toneIndigo
class node_node_shell,node_node_ntfs toneNeutral
```

## Components

### Root

Application entrypoint and packaging

- [App](https://github.com/arnobpl/symlinkcreator/blob/main/SymlinkCreator/App.xaml): wpf app · Application resources and startup wiring · `SymlinkCreator/App.xaml`
- [Bootstrap](https://github.com/arnobpl/symlinkcreator/blob/main/SymlinkCreator/App.xaml.cs): startup · WPF application entrypoint · `SymlinkCreator/App.xaml.cs`
- [Manifest](https://github.com/arnobpl/symlinkcreator/blob/main/SymlinkCreator/app.manifest): packaging · Windows compatibility and elevation settings · `SymlinkCreator/app.manifest`
- [App config](https://github.com/arnobpl/symlinkcreator/blob/main/SymlinkCreator/App.config): runtime config · Desktop runtime configuration · `SymlinkCreator/App.config`

### Core

Symlink domain logic and execution boundary

- [Settings](https://github.com/arnobpl/symlinkcreator/blob/main/SymlinkCreator/core/ApplicationConfiguration.cs): configuration · App-level options for symlink behavior · `SymlinkCreator/core/ApplicationConfiguration.cs`
- [Symlink agent](https://github.com/arnobpl/symlinkcreator/blob/main/SymlinkCreator/core/SymlinkAgent.cs): domain service · Coordinates path validation and script generation · `SymlinkCreator/core/SymlinkAgent.cs`
- [Script executor](https://github.com/arnobpl/symlinkcreator/blob/main/SymlinkCreator/core/ScriptExecutor.cs): process boundary · Runs generated mklink scripts in Windows shell · `SymlinkCreator/core/ScriptExecutor.cs`

### UI

WPF windows, view model, and helpers

- [Main window](https://github.com/arnobpl/symlinkcreator/blob/main/SymlinkCreator/ui/mainWindow/MainWindow.xaml): wpf view · Primary user-facing window · `SymlinkCreator/ui/mainWindow/MainWindow.xaml`
- [Main code](https://github.com/arnobpl/symlinkcreator/blob/main/SymlinkCreator/ui/mainWindow/MainWindow.xaml.cs): view code-behind · Window wiring and event handling · `SymlinkCreator/ui/mainWindow/MainWindow.xaml.cs`
- [Main VM](https://github.com/arnobpl/symlinkcreator/blob/main/SymlinkCreator/ui/mainWindow/MainWindowViewModel.cs): view model · Bridges UI state to core operations · `SymlinkCreator/ui/mainWindow/MainWindowViewModel.cs`
- [About window](https://github.com/arnobpl/symlinkcreator/blob/main/SymlinkCreator/ui/aboutWindow/AboutWindow.xaml): wpf view · Secondary informational window · `SymlinkCreator/ui/aboutWindow/AboutWindow.xaml`
- [About code](https://github.com/arnobpl/symlinkcreator/blob/main/SymlinkCreator/ui/aboutWindow/AboutWindow.xaml.cs): view code-behind · About window behavior · `SymlinkCreator/ui/aboutWindow/AboutWindow.xaml.cs`
- [Long paths](https://github.com/arnobpl/symlinkcreator/blob/main/SymlinkCreator/ui/utility/LongPathAware.cs): utility · Long path support helper · `SymlinkCreator/ui/utility/LongPathAware.cs`
- [Admin shield](https://github.com/arnobpl/symlinkcreator/blob/main/SymlinkCreator/ui/utility/NativeAdminShieldIcon.cs): utility · Shell icon helper for elevation cues · `SymlinkCreator/ui/utility/NativeAdminShieldIcon.cs`
- [Maximize btn](https://github.com/arnobpl/symlinkcreator/blob/main/SymlinkCreator/ui/utility/WindowMaximizeButton.cs): utility · Custom window chrome helper · `SymlinkCreator/ui/utility/WindowMaximizeButton.cs`

### Tests

Unit test project

- [Symlink tests](https://github.com/arnobpl/symlinkcreator/blob/main/SymlinkCreatorTests/SymlinkUtilityTest.cs): unit tests · Focused tests for symlink utility behavior · `SymlinkCreatorTests/SymlinkUtilityTest.cs`

### Assets

Icons and documentation media

- [Icons](https://github.com/arnobpl/symlinkcreator/tree/main/SymlinkCreator/resources/icons): assets · Application icon resources · `SymlinkCreator/resources/icons`
- [Docs media](https://github.com/arnobpl/symlinkcreator/tree/main/SymlinkCreator/_ReadMe): assets · Screenshots and presentation assets · `SymlinkCreator/_ReadMe`

### Other components

- **Windows shell**: external runtime · Command interpreter used to execute scripts
- **NTFS**: external filesystem · Target filesystem for created symbolic links

## Connections

- App → Bootstrap: starts · WPF startup wiring
- Bootstrap → Main window: opens · Creates the primary window
- Main window → Main code: backing · Window markup and code-behind pair
- Main code → Main VM: binds · Connects UI events to the view model
- Main VM → Settings: reads · Uses app options while building requests
- Main VM → Symlink agent: invokes · Starts symlink creation workflow
- Symlink agent → Settings: applies · Uses configuration to shape script generation
- Symlink agent → Script executor: hands off · Delegates execution after script generation
- Script executor → Windows shell: runs in · Executes the generated command script
- Windows shell → NTFS: creates links · mklink writes links on the filesystem
- Main code → About window: opens · Shows informational window
- About window → About code: backing · About window markup and code-behind pair
- Main code → Long paths: uses · Supports long-path-aware UI behavior
- Main code → Admin shield: uses · Displays elevation-related shell affordance
- Main code → Maximize btn: uses · Provides custom window chrome
- Symlink tests → Symlink agent: verifies · Exercises path and symlink utility behavior
- Symlink tests → Script executor: verifies · Covers execution-related utility behavior
- Manifest → Script executor: supports · Declares Windows compatibility and elevation intent
- Icons → Main window: skins · Supplies application visuals
- Docs media → Main window: documents · Repository presentation assets
