diff --git a/CHANGELOG.md b/CHANGELOG.md
index fb75554..e89cfac 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,6 +1,7 @@
# Changelog
## 1.0.8
+* \#36: Add ability to select Linux distribution type if OS is unsupported
* Added additional WinFsp uninstall strings
## 1.0.7
diff --git a/public/electron.js b/public/electron.js
index 6772291..769822f 100644
--- a/public/electron.js
+++ b/public/electron.js
@@ -28,6 +28,7 @@ let expectedUnmount = {};
let launchHidden = false;
let firstMountCheck = true;
let manualMountDetection = {};
+let platformOverride;
let isShutdown = false;
let isQuiting = false;
@@ -244,6 +245,7 @@ const loadUiSettings = () => {
if (fs.statSync(settingFile).isFile()) {
const settings = JSON.parse(fs.readFileSync(settingFile, 'utf8'));
launchHidden = settings.launch_hidden;
+ platformOverride = settings.platform_override;
}
} catch (e) {
}
@@ -659,13 +661,16 @@ ipcMain.on(Constants.IPC_Get_Platform, (event) => {
const platform = os.platform();
if (platform === 'linux') {
- const scriptFile = path.join(os.tmpdir(), 'repertory_detect_linux.sh');
- fs.writeFileSync(scriptFile, detectScript);
+ if (platformOverride && (platformOverride.trim().length > 0)) {
+ sendResponse(platformOverride, 'linux');
+ } else {
+ const scriptFile = path.join(os.tmpdir(), 'repertory_detect_linux.sh');
+ fs.writeFileSync(scriptFile, detectScript);
- helpers
+ helpers
.executeScript(scriptFile)
.then(data => {
- let appPlatform = data.replace(/(\r\n|\n|\r)/gm,"");
+ let appPlatform = data.replace(/(\r\n|\n|\r)/gm, "");
if (appPlatform === 'unknown') {
helpers
.downloadFile(Constants.LINUX_DETECT_SCRIPT_URL, scriptFile, null, err => {
@@ -673,14 +678,14 @@ ipcMain.on(Constants.IPC_Get_Platform, (event) => {
sendResponse(appPlatform, platform);
} else {
helpers
- .executeScript(scriptFile)
- .then(data => {
- appPlatform = data.replace(/(\r\n|\n|\r)/gm, "");
- sendResponse(appPlatform, platform);
- })
- .catch(() => {
- sendResponse(appPlatform, platform);
- });
+ .executeScript(scriptFile)
+ .then(data => {
+ appPlatform = data.replace(/(\r\n|\n|\r)/gm, "");
+ sendResponse(appPlatform, platform);
+ })
+ .catch(() => {
+ sendResponse(appPlatform, platform);
+ });
}
});
} else {
@@ -690,6 +695,7 @@ ipcMain.on(Constants.IPC_Get_Platform, (event) => {
.catch(() => {
sendResponse(platform, platform);
});
+ }
} else {
sendResponse(platform, platform);
}
diff --git a/src/App.js b/src/App.js
index b0ae7f8..c36adc6 100644
--- a/src/App.js
+++ b/src/App.js
@@ -14,7 +14,11 @@ import MountItems from './containers/MountItems/MountItems';
import {notifyError} from './redux/actions/error_actions';
import Reboot from './components/Reboot/Reboot';
import ReleaseVersionDisplay from './components/ReleaseVersionDisplay/ReleaseVersionDisplay';
-import {saveState} from './redux/actions/common_actions';
+import {
+ displaySelectAppPlatform,
+ saveState
+} from './redux/actions/common_actions';
+import SelectAppPlatform from './components/SelectAppPlatform/SelectAppPlatform';
import Text from './components/UI/Text/Text';
import UpgradeIcon from './components/UpgradeIcon/UpgradeIcon';
import UpgradeUI from './components/UpgradeUI/UpgradeUI';
@@ -30,7 +34,11 @@ class App extends IPCContainer {
componentDidMount() {
const detectUpgrades = () => {
if (this.props.AppPlatform === 'unknown') {
- this.props.notifyError('Operating system is not supported.', true);
+ if (this.props.Platform === 'linux') {
+ this.props.displaySelectAppPlatform(true);
+ } else {
+ this.props.notifyError('Operating system is not supported.', true);
+ }
} else {
this.props.loadReleases();
}
@@ -119,9 +127,12 @@ class App extends IPCContainer {
const downloadDisplay = this.createModalConditionally(this.props.DownloadActive,
Repertory was unable to detect your Linux distribution. Please select one of the following and click 'Test' to continue:
+