Follow these instructions to create a single executable file that you can share with others.
- Request your DNA data
- Go to your Ancestry Settings
- Click on your name
- Scroll to the bottom
- Click on "Download DNA data"
- Click through requesting the data
- Wait for the email from Ancestry
- Wait about 30 minutes
- Click the link in the email
- Click "Download DNA data"
- Extract the zip file
- Run the
DNAViewer.exeprogram
- Go 1.16 or later installed
Create the following project structure:
dnaviewer/
├── main.go # Main server file
├── go.mod # Go module file
├── model/ # DNA data models
│ └── dna.go
├── parser/ # File parser
│ └── parser.go
├── search/ # Search algorithms
│ └── search.go
└── web/ # Web interface files (embedded in the executable)
├── index.html # HTML interface
├── style.css # CSS styling
└── app.js # JavaScript codeUpdate your go.mod file:
go mod init github.com/yourusername/dnaviewer
go mod tidyRun the following command to build a single executable file:
go build -ldflags="-s -w -H=windowsgui" -o DNAViewer.exeThe flags explained:
-s -w: Reduces the binary size by removing debug information-H=windowsgui: Hides the terminal window when running the application
To compile for Windows on an alternate system:
GOOS=windows GOARCH=amd64 go build -ldflags="-s -w" -o DNAViewer.exeGOOS=darwin GOARCH=amd64 go build -ldflags="-s -w" -o DNAViewerGOOS=linux GOARCH=amd64 go build -ldflags="-s -w" -o DNAViewerRun the executable by double-clicking it. It should:
- Start a local web server
- Automatically open your default browser
- Display the DNA Viewer interface
You can now distribute the single executable file (DNAViewer.exe for Windows) to others. When they run it:
- No installation is required
- The application will open in their default browser
- All functionality works without any additional dependencies
-
Security Settings: On Windows, the executable might trigger SmartScreen on first run. The recipient may need to click "More info" and "Run anyway".
-
Firewall Access: The application needs to access localhost, which most firewalls allow by default. However, if users encounter issues, they may need to allow the application through their firewall.
-
File Size: The executable will be 10-15 MB due to the embedded web resources and Go runtime.
-
Browser Requirement: A modern web browser is required (Chrome, Firefox, Edge, or Safari).