Skip to content

Commit

Permalink
fixup! feature: add ensure node libraries installed on PC
Browse files Browse the repository at this point in the history
  • Loading branch information
maparr committed Sep 20, 2023
1 parent 5007ccd commit 3bbf51f
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 12 deletions.
26 changes: 16 additions & 10 deletions app/screens/network/Network.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,12 @@ const Network = ({ history }) => {
eventsService.showFileInFolder({ isLogFile: true });
};

const isShowNotSpecifiedErrorCheckList = [
NodeErrorType.NOT_SPECIFIED,
NodeErrorType.OPEN_CL_NOT_INSTALLED,
NodeErrorType.REDIST_NOT_INSTALLED,
].includes((nodeError?.type as unknown) as NodeErrorType);

return (
<>
<WrapperWith2SideBars
Expand All @@ -294,16 +300,6 @@ const Network = ({ history }) => {
<>
<ErrorMessage compact>
{nodeError.msg || nodeError.stackTrace}
{nodeError?.type === NodeErrorType.NOT_SPECIFIED && (
<ErrorMessage compact>
WE HAVE A CHECKLIST THAT CAN HELP YOU DETECT THE ISSUE.{' '}
<Link
style={{ display: 'inline-block' }}
onClick={() => setOpenCheckListModal(true)}
text="OPEN CHECKLIST."
/>
</ErrorMessage>
)}
{nodeError?.type === NodeErrorType.OPEN_CL_NOT_INSTALLED && (
<>
{isWindows && (
Expand All @@ -329,6 +325,16 @@ const Network = ({ history }) => {
text="REDIST INSTALLATION GUIDE."
/>
)}
{isShowNotSpecifiedErrorCheckList && (
<ErrorMessage compact>
WE HAVE A CHECKLIST THAT CAN HELP YOU DETECT THE ISSUE.{' '}
<Link
style={{ display: 'inline-block' }}
onClick={() => setOpenCheckListModal(true)}
text="OPEN CHECKLIST."
/>
</ErrorMessage>
)}
</ErrorMessage>
</>
)}
Expand Down
6 changes: 4 additions & 2 deletions desktop/checkRequiredLibs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,17 @@ const exec = promisify(execCallback);
const access = promisify(fs.access);

const generateInstallationError = (packageName, type): NodeError => ({
msg: `Oops! It looks like ${packageName} is missing or not set up on your system. Our application requires ${packageName} support to run properly.\n`,
msg: `Oops! It looks like ${packageName} is missing or not set up on your system.\n`,
stackTrace: '',
type,
level: NodeErrorLevel.LOG_LEVEL_FATAL,
module: 'NodeManager',
});

const checkVisualCppRedist = async () => {
const command = 'wmic product get description | find "Microsoft Visual C++"';
// Find software names containing "Microsoft Visual C++"
const command =
'wmic product where "name like \'%%Microsoft Visual C++%%\'" get name';

try {
const { stdout, stderr } = await exec(command);
Expand Down

0 comments on commit 3bbf51f

Please sign in to comment.