Skip to content

Commit

Permalink
Release v0.8.2
Browse files Browse the repository at this point in the history
* the PDF download of the documentation on readthedocs.org now shows the correct version number
* the web interface of the DCS-BIOS Hub should now work on Internet Explorer and Edge browsers
* the FA-18C Hornet is correctly recognized as an installed module
* the automatic setup of Lua scripts no longer fails if the "Scripts" and/or "Hooks" directories do not exist in the user profile
* improved error message when the user profile does not exist at all
* the installer now saves the install location in the Windows registry at HKLM\Software\DCS-BIOS\DCS-BIOS Hub\Path. Third-party software could use this registry key to locate the control reference JSON files.
* the installation documentation now explicitly mentions the name of the installer file
  • Loading branch information
jboecker committed Oct 28, 2019
2 parents 7931216 + e45d12e commit 3704ec3
Show file tree
Hide file tree
Showing 10 changed files with 64 additions and 19 deletions.
20 changes: 20 additions & 0 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# .readthedocs.yml
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

# Required
version: 2

# Build documentation in the doc/ directory with Sphinx
sphinx:
configuration: doc/conf.py

# Optionally build your docs in additional formats such as PDF and ePub
formats: all

# Optionally set the version of Python and requirements required to build your docs
python:
version: 3.7
install:
- requirements: doc/requirements.txt

12 changes: 3 additions & 9 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,15 @@
version: v0.8.1+{build}
version: v0.8.2+{build}
pull_requests:
do_not_increment_build_number: true
image: Visual Studio 2017
clone_depth: 100
install:
- cmd: >-
- cmd: |
set PATH=%PATH%;C:\Program Files (x86)\WiX Toolset v3.11\bin
set GOPATH=C:\Users\appveyor
set PATH=%PATH%;%GOPATH%\bin
go get "github.com/Masterminds/semver"
pip install sphinx
pip install sphinx_rtd_theme
pip install sphinx sphinx_rtd_theme pyyaml
build_script:
- ps: |
Expand Down
5 changes: 3 additions & 2 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
# import sys
# sys.path.insert(0, os.path.abspath('.'))

import yaml

# -- Project information -----------------------------------------------------

Expand All @@ -22,7 +23,7 @@
author = 'DCS-BIOS Contributors'

# The full version, including alpha/beta/rc tags
release = 'v0.8.0'
release = yaml.load(open("../appveyor.yml"))["version"].split("+")[0]


# -- General configuration ---------------------------------------------------
Expand Down Expand Up @@ -55,4 +56,4 @@
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']
html_logo = 'images/logo.png'
html_logo = 'images/logo.png'
2 changes: 1 addition & 1 deletion doc/installation.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Installing DCS-BIOS
===================

Download and run the installer file for the `latest stable release <https://github.com/dcs-bios/dcs-bios/releases/latest/>`_ from GitHub.
Download and run the installer (called DCS-BIOS-Hub-Setup-*version*.msi) for the `latest stable release <https://github.com/dcs-bios/dcs-bios/releases/latest/>`_ from GitHub.


.. note::
Expand Down
4 changes: 4 additions & 0 deletions doc/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
sphinx
sphinx_rtd_theme
pyyaml

27 changes: 20 additions & 7 deletions src/hub-backend/dcssetup/dcssetup_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ func RegisterApi(jsonAPI *jsonapi.JsonApi) {

// GetInstalledModulesList returns a list of all installed DCS: World modules.
func GetInstalledModulesList() []string {
var folderNamesToModuleDefinitionNames = map[string][]string{
"FA-18C": {"FA-18C_hornet"},
}
moduleSet := make(map[string]struct{}, 0)

scanDcsInstallDir := func(path string) {
Expand All @@ -64,6 +67,11 @@ func GetInstalledModulesList() []string {
if fi.IsDir() {
moduleSet[strings.ToLower(fi.Name())] = struct{}{}
}
if otherDefinitonNames, ok := folderNamesToModuleDefinitionNames[fi.Name()]; ok {
for _, name := range otherDefinitonNames {
moduleSet[strings.ToLower(name)] = struct{}{}
}
}
}
}

Expand Down Expand Up @@ -252,6 +260,7 @@ func createProfileSubdir(profileDir string, subdirName string, logBuffer io.Writ
stat, err := os.Stat(fullSubdirPath)
if err != nil {
// does not exist
fmt.Fprintf(logBuffer, "creating directory: %s\n", fullSubdirPath)
err = os.Mkdir(fullSubdirPath, 0777)
if err != nil {
fmt.Fprintf(logBuffer, "error: could not create directory %s: %v\n", fullSubdirPath, err)
Expand All @@ -273,7 +282,7 @@ func SetupExportLua(profileDir string, shouldBeInstalled bool) (ok bool, logMess
// assert that profileDir exists and is a directory
stat, err := os.Stat(profileDir)
if err != nil || !stat.IsDir() {
fmt.Fprintf(logBuffer, "error: not a directory: %s\n", profileDir)
fmt.Fprintf(logBuffer, "error: profile directory does not exist, please start and exit DCS and try again: %s\n", profileDir)
return false, logBuffer.String()
}

Expand All @@ -287,6 +296,7 @@ func SetupExportLua(profileDir string, shouldBeInstalled bool) (ok bool, logMess
var existingExportLuaReader io.Reader
exportLuaFilePath := filepath.Join(profileDir, "Scripts", "Export.lua")
stat, err = os.Stat(exportLuaFilePath)

if err != nil {
// Export.lua does not exist yet
existingExportLuaReader = &bytes.Buffer{}
Expand All @@ -300,10 +310,6 @@ func SetupExportLua(profileDir string, shouldBeInstalled bool) (ok bool, logMess

// try setup
newExportLuaContent := GetModifiedExportLua(existingExportLuaReader, shouldBeInstalled, logBuffer)
if err != nil {
fmt.Fprintf(logBuffer, "error while generating new Export.lua content: %v\n", err)
return false, logBuffer.String()
}
file, err := os.Create(exportLuaFilePath)
if err != nil {
fmt.Fprintf(logBuffer, "error: could not open Export.lua for writing: %v\n", err)
Expand Down Expand Up @@ -338,18 +344,25 @@ func uninstallHook(profileDir string, hookDef *hookDefinition, logBuffer io.Writ
}
err = os.Remove(hookFile)
if err != nil {
fmt.Fprint(logBuffer, "error: could not delete %s: %v\n", hookFile, err)
fmt.Fprintf(logBuffer, "error: could not delete %s: %v\n", hookFile, err)
return false
}
fmt.Fprintf(logBuffer, "deleted: %s\n", hookFile)
return true
}
func installHook(profileDir string, hookDefinition *hookDefinition, logBuffer io.Writer) bool {
// assert that profileDir exists and is a directory
stat, err := os.Stat(profileDir)
if err != nil || !stat.IsDir() {
fmt.Fprintf(logBuffer, "error: profile directory does not exist, please start and exit DCS and try again: %s\n", profileDir)
return false
}

uninstallHook(profileDir, hookDefinition, logBuffer)
if !createProfileSubdir(profileDir, "Scripts", logBuffer) {
return false
}
if !createProfileSubdir(profileDir, "Hooks", logBuffer) {
if !createProfileSubdir(profileDir, "Scripts\\Hooks", logBuffer) {
return false
}
hookFile := filepath.Join(profileDir, "Scripts", "Hooks", hookDefinition.filename)
Expand Down
5 changes: 5 additions & 0 deletions src/hub-frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions src/hub-frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"@types/react-router-dom": "^5.1.0",
"@types/react-router-hash-link": "^1.2.1",
"@types/websocket": "0.0.40",
"array-flat-polyfill": "^1.0.1",
"codemirror": "^5.49.0",
"react": "^16.10.2",
"react-codemirror2": "^6.0.0",
Expand Down
2 changes: 2 additions & 0 deletions src/hub-frontend/src/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import 'array-flat-polyfill';

import React from 'react';
import ReactDOM from 'react-dom';
import './index.css';
Expand Down
5 changes: 5 additions & 0 deletions src/installer/product.wxs
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,16 @@
</Component>
</Directory>
</Directory>

<Component Id="CMP_InstallDirRegistryKey" Guid="85307F57-4580-46FA-92A8-E989D26F5E0C">
<RegistryValue Root="HKLM" Key="Software\DCS-BIOS\DCS-BIOS Hub" Name="Path" Type="string" Value="[INSTALLDIR]" KeyPath="yes"/>
</Component>
</Directory>

<Feature Id="DcsBios" Title="DCS-BIOS" Level="1" Absent="disallow">
<ComponentRef Id="CMP_mainexe"/>
<ComponentRef Id="CMP_StartMenuShortcut"/>
<ComponentRef Id="CMP_InstallDirRegistryKey"/>
<ComponentGroupRef Id="CMP_DcsLuaFiles"/>
<ComponentGroupRef Id="CMP_ControlReferenceJsonFiles"/>
<ComponentGroupRef Id="CMP_FrontendApp"/>
Expand Down

0 comments on commit 3704ec3

Please sign in to comment.