SEARCH-598 and SEARCH-611 (Deleting data folder on Electron Crash) (#307)

- Deleting the data folder on crash and unexpected shutdown
- Created script for clearing the index data on start up
- Working in dev env
- Added path to package
- Windows path file change
- Working on production build
- Completed implementation
- Few changes to callback
- Few changes to callback
- Updated package
- Fixed windows bug
- Fixed windows bug
- Fixed windows bug
- Added exe for task
- Added exe for task
- Fixed exe file
- Code refactoring
- Updated api file
- Added uuid for the task name
- Updated exe for the uuid
- Updated API file
- AIP version
- Fixes all the scenarios for mac
- Updated the boot file to clear data file on login
- Fixed data folder deleting on application is open
- Windows launch agent
- Working on all the scenario
- Added a launch script and starting the register
- Updated search-win-task.exe file
- Updating the aip file
- Updating the aip file
- Removed randomString lib
- Requested changes (PR)
- Included the library from new repo electron-uitls
- Updated AIP file
- Updated AIP
- Bumped up electron-utils version
- Added missing quotes
- Bumped up electron-utils version
- Added missing quotes
- Bumped utils version
- Bumped utils version
- Update AIP
This commit is contained in:
Keerthi Niranjan 2018-03-15 16:37:50 +05:30 committed by Vishwas Shashidhar
parent e0b831bcde
commit c3b82a0869
9 changed files with 313 additions and 34 deletions

View File

@ -73,6 +73,9 @@
<COMPONENT cid="caphyon.advinst.msicomp.MsiCompsComponent">
<ROW Component="AI_CustomARPName" ComponentId="{2817ACD9-F494-4729-9830-111EF3311CFA}" Directory_="APPDIR" Attributes="4" KeyPath="DisplayName" Options="1"/>
<ROW Component="AI_DisableModify" ComponentId="{DA4E8013-2F4B-493A-90A8-BD729DA7EE2C}" Directory_="APPDIR" Attributes="260" KeyPath="NoModify" Options="1"/>
<ROW Component="ClearOnBoot.exe" ComponentId="{843C570A-B7E8-47A2-B89E-B44134018CFE}" Directory_="library_Dir" Attributes="0" KeyPath="ClearOnBoot.exe"/>
<ROW Component="ClearSchTasks.exe" ComponentId="{8799FBC2-2891-4F00-85DE-DABC958180DC}" Directory_="library_Dir" Attributes="0" KeyPath="ClearSchTasks.exe"/>
<ROW Component="FreeDiskSpace.exe" ComponentId="{CE0B1191-6964-422E-9684-6BC490C6F97E}" Directory_="library_Dir" Attributes="0" KeyPath="FreeDiskSpace.exe"/>
<ROW Component="Jobber.exe" ComponentId="{D019D33C-26A6-400F-9C74-D862032D1A5B}" Directory_="jobber_Dir" Attributes="0" KeyPath="Jobber.exe"/>
<ROW Component="PodUrl" ComponentId="{EA80D82D-BC65-4075-A9A8-F53E2B2513CE}" Directory_="APPDIR" Attributes="260" KeyPath="PodUrl"/>
<ROW Component="ProductInformation" ComponentId="{8B92B687-8AE0-4A5C-B6AB-5D1854009CEA}" Directory_="APPDIR" Attributes="4" KeyPath="Version"/>
@ -130,13 +133,10 @@
<ROW Component="index.d.ts" ComponentId="{74D261F1-A6C5-49DD-8554-E48337CC04AF}" Directory_="src_Dir" Attributes="0" KeyPath="index.d.ts" Type="0"/>
<ROW Component="index.js" ComponentId="{77C48E00-B684-4E72-ACF4-15DD0253EF43}" Directory_="lib_Dir" Attributes="0" KeyPath="index.js" Type="0"/>
<ROW Component="indexvalidatorx64.exe" ComponentId="{0266F3CF-5462-4381-9971-2353034D7E1D}" Directory_="library_Dir" Attributes="256" KeyPath="indexvalidatorx64.exe"/>
<ROW Component="indexvalidatorx86.exe" ComponentId="{DE7AEDE9-CF30-4DB1-BC38-6CA6F1CDCAAC}" Directory_="library_Dir" Attributes="0" KeyPath="indexvalidatorx86.exe"/>
<ROW Component="libEGL.dll" ComponentId="{8EEC76AB-3601-4D11-B13E-32EC2A38C539}" Directory_="APPDIR" Attributes="256" KeyPath="libEGL.dll"/>
<ROW Component="libGLESv2.dll" ComponentId="{0E8B8B21-B4C0-45C9-95D3-637FD93A4EC0}" Directory_="APPDIR" Attributes="256" KeyPath="libGLESv2.dll"/>
<ROW Component="libsymphonysearchx64.dll" ComponentId="{A8C99D17-FA62-4996-8FAE-52D1DCF9BF26}" Directory_="library_Dir" Attributes="256" KeyPath="libsymphonysearchx64.dll"/>
<ROW Component="libsymphonysearchx86.dll" ComponentId="{AB1E061B-1558-4A57-B4C3-C2952E7471B2}" Directory_="library_Dir" Attributes="0" KeyPath="libsymphonysearchx86.dll"/>
<ROW Component="lz4winx64.exe" ComponentId="{8B78B313-EAE9-4533-AFEB-56F9E0CA73A1}" Directory_="library_Dir" Attributes="256" KeyPath="lz4winx64.exe"/>
<ROW Component="lz4winx86.exe" ComponentId="{907532E8-1E4B-48A5-B48B-7B05BE80D1A1}" Directory_="library_Dir" Attributes="0" KeyPath="lz4winx86.exe"/>
<ROW Component="msvcp140.dll" ComponentId="{93A6289C-CF23-4BB8-A579-7FDDD1D15591}" Directory_="APPDIR" Attributes="256" KeyPath="msvcp140.dll"/>
<ROW Component="node.dll" ComponentId="{C0972355-339E-438C-94A3-74174DE4C6B6}" Directory_="APPDIR" Attributes="256" KeyPath="node.dll"/>
<ROW Component="node_modules" ComponentId="{A4EB33A8-FEA8-40A5-94EF-705EBE64DDC1}" Directory_="node_modules_Dir" Attributes="0"/>
@ -147,12 +147,15 @@
</COMPONENT>
<COMPONENT cid="caphyon.advinst.msicomp.MsiFeatsComponent">
<ROW Feature="D564007E3BBE4F85950A09B470A7CA65" Title="Visual C++ Redistributable for Visual Studio 2013 x86" Description="Visual C++ Redistributable for Visual Studio 2013 x86" Display="3" Level="1" Attributes="0"/>
<ROW Feature="MainFeature" Title="MainFeature" Description="Description" Display="1" Level="1" Directory_="APPDIR" Attributes="0" Components="AI_CustomARPName AI_DisableModify Jobber.exe PodUrl ProductInformation ScreenSnippet.exe Symphony Symphony.config Symphony.exe am.pak ambient.d.ts apimswincoreconsolel110.dll apimswincoredatetimel110.dll apimswincoredebugl110.dll apimswincoreerrorhandlingl110.dll apimswincorefilel110.dll apimswincorefilel120.dll apimswincorefilel210.dll apimswincorehandlel110.dll apimswincoreheapl110.dll apimswincoreinterlockedl110.dll apimswincorelibraryloaderl110.dll apimswincorelocalizationl120.dll apimswincorememoryl110.dll apimswincorenamedpipel110.dll apimswincoreprocessenvironmentl110.dll apimswincoreprocessthreadsl110.dll apimswincoreprocessthreadsl111.dll apimswincoreprofilel110.dll apimswincorertlsupportl110.dll apimswincorestringl110.dll apimswincoresynchl110.dll apimswincoresynchl120.dll apimswincoresysinfol110.dll apimswincoretimezonel110.dll apimswincoreutill110.dll apimswincrtconiol110.dll apimswincrtconvertl110.dll apimswincrtenvironmentl110.dll apimswincrtfilesysteml110.dll apimswincrtheapl110.dll apimswincrtlocalel110.dll apimswincrtmathl110.dll apimswincrtmultibytel110.dll apimswincrtprivatel110.dll apimswincrtprocessl110.dll apimswincrtruntimel110.dll apimswincrtstdiol110.dll apimswincrtstringl110.dll apimswincrttimel110.dll apimswincrtutilityl110.dll appupdate.yml blink_image_resources_200_percent.pak cld.node d3dcompiler_47.dll ffmpeg.dll index.d.ts index.js indexvalidatorx64.exe indexvalidatorx86.exe libEGL.dll libGLESv2.dll libsymphonysearchx64.dll libsymphonysearchx86.dll lz4winx64.exe lz4winx86.exe msvcp140.dll node.dll node_modules npmignore tarwin.exe ucrtbase.dll vcruntime140.dll"/>
<ROW Feature="MainFeature" Title="MainFeature" Description="Description" Display="1" Level="1" Directory_="APPDIR" Attributes="0" Components="AI_CustomARPName AI_DisableModify ClearOnBoot.exe ClearSchTasks.exe FreeDiskSpace.exe Jobber.exe PodUrl ProductInformation ScreenSnippet.exe Symphony Symphony.config Symphony.exe am.pak ambient.d.ts apimswincoreconsolel110.dll apimswincoredatetimel110.dll apimswincoredebugl110.dll apimswincoreerrorhandlingl110.dll apimswincorefilel110.dll apimswincorefilel120.dll apimswincorefilel210.dll apimswincorehandlel110.dll apimswincoreheapl110.dll apimswincoreinterlockedl110.dll apimswincorelibraryloaderl110.dll apimswincorelocalizationl120.dll apimswincorememoryl110.dll apimswincorenamedpipel110.dll apimswincoreprocessenvironmentl110.dll apimswincoreprocessthreadsl110.dll apimswincoreprocessthreadsl111.dll apimswincoreprofilel110.dll apimswincorertlsupportl110.dll apimswincorestringl110.dll apimswincoresynchl110.dll apimswincoresynchl120.dll apimswincoresysinfol110.dll apimswincoretimezonel110.dll apimswincoreutill110.dll apimswincrtconiol110.dll apimswincrtconvertl110.dll apimswincrtenvironmentl110.dll apimswincrtfilesysteml110.dll apimswincrtheapl110.dll apimswincrtlocalel110.dll apimswincrtmathl110.dll apimswincrtmultibytel110.dll apimswincrtprivatel110.dll apimswincrtprocessl110.dll apimswincrtruntimel110.dll apimswincrtstdiol110.dll apimswincrtstringl110.dll apimswincrttimel110.dll apimswincrtutilityl110.dll appupdate.yml blink_image_resources_200_percent.pak cld.node d3dcompiler_47.dll ffmpeg.dll index.d.ts index.js indexvalidatorx64.exe libEGL.dll libGLESv2.dll libsymphonysearchx64.dll lz4winx64.exe msvcp140.dll node.dll node_modules npmignore tarwin.exe ucrtbase.dll vcruntime140.dll"/>
<ATTRIBUTE name="CurrentFeature" value="MainFeature"/>
</COMPONENT>
<COMPONENT cid="caphyon.advinst.msicomp.MsiFilesComponent">
<ROW File="CODE_OF_CONDUCT.md" Component_="npmignore" FileName="CODE_O~1.MD|CODE_OF_CONDUCT.md" Attributes="0" SourcePath="..\..\dist\win-unpacked\resources\app.asar.unpacked\node_modules\spawn-rx\CODE_OF_CONDUCT.md" SelfReg="false" NextFile="COPYING"/>
<ROW File="COPYING" Component_="npmignore" FileName="COPYING" Attributes="0" SourcePath="..\..\dist\win-unpacked\resources\app.asar.unpacked\node_modules\spawn-rx\COPYING" SelfReg="false" NextFile="esdoc.json"/>
<ROW File="ClearOnBoot.exe" Component_="ClearOnBoot.exe" FileName="CLEARO~1.EXE|ClearOnBoot.exe" Attributes="0" SourcePath="..\..\node_modules\electron-utils\ClearOnBoot\bin\Release\ClearOnBoot.exe" SelfReg="false" NextFile="ClearSchTasks.exe" DigSign="true"/>
<ROW File="ClearSchTasks.exe" Component_="ClearSchTasks.exe" FileName="CLEARS~1.EXE|ClearSchTasks.exe" Attributes="0" SourcePath="..\..\node_modules\electron-utils\ClearSchTasks\bin\Release\ClearSchTasks.exe" SelfReg="false" NextFile="FreeDiskSpace.exe" DigSign="true"/>
<ROW File="FreeDiskSpace.exe" Component_="FreeDiskSpace.exe" FileName="FREEDI~1.EXE|FreeDiskSpace.exe" Attributes="0" SourcePath="..\..\node_modules\electron-utils\FreeDiskSpace\bin\Release\FreeDiskSpace.exe" SelfReg="false" DigSign="true"/>
<ROW File="Jobber.exe" Component_="Jobber.exe" FileName="Jobber.exe" Attributes="0" SourcePath="..\..\dist\win-unpacked\resources\app.asar.unpacked\node_modules\spawn-rx\vendor\jobber\Jobber.exe" SelfReg="false" NextFile="cld.node" DigSign="true"/>
<ROW File="LICENSE.electron.txt" Component_="blink_image_resources_200_percent.pak" FileName="LICENS~1.TXT|LICENSE.electron.txt" Attributes="0" SourcePath="..\..\dist\win-unpacked\LICENSE.electron.txt" SelfReg="false" NextFile="LICENSES.chromium.html"/>
<ROW File="LICENSES.chromium.html" Component_="blink_image_resources_200_percent.pak" FileName="LICENS~1.HTM|LICENSES.chromium.html" Attributes="0" SourcePath="..\..\dist\win-unpacked\LICENSES.chromium.html" SelfReg="false" NextFile="natives_blob.bin"/>
@ -243,20 +246,17 @@
<ROW File="index.js.map" Component_="index.d.ts" FileName="INDEXJ~1.MAP|index.js.map" Attributes="0" SourcePath="..\..\dist\win-unpacked\resources\app.asar.unpacked\node_modules\spawn-rx\lib\src\index.js.map" SelfReg="false" NextFile="package.json"/>
<ROW File="index.js_1" Component_="index.d.ts" FileName="index.js" Attributes="0" SourcePath="..\..\dist\win-unpacked\resources\app.asar.unpacked\node_modules\spawn-rx\lib\src\index.js" SelfReg="false" NextFile="index.js.map"/>
<ROW File="index.ts" Component_="ambient.d.ts" FileName="index.ts" Attributes="0" SourcePath="..\..\dist\win-unpacked\resources\app.asar.unpacked\node_modules\spawn-rx\src\index.ts" SelfReg="false" NextFile="tsconfig.json"/>
<ROW File="indexvalidatorx64.exe" Component_="indexvalidatorx64.exe" FileName="INDEXV~1.EXE|indexvalidator-x64.exe" Attributes="0" SourcePath="..\..\library\indexvalidator-x64.exe" SelfReg="false" NextFile="indexvalidatorx86.exe" DigSign="true"/>
<ROW File="indexvalidatorx86.exe" Component_="indexvalidatorx86.exe" FileName="INDEXV~2.EXE|indexvalidator-x86.exe" Attributes="0" SourcePath="..\..\library\indexvalidator-x86.exe" SelfReg="false" NextFile="libsymphonysearchx64.dll" DigSign="true"/>
<ROW File="indexvalidatorx64.exe" Component_="indexvalidatorx64.exe" FileName="INDEXV~1.EXE|indexvalidator-x64.exe" Attributes="0" SourcePath="..\..\library\indexvalidator-x64.exe" SelfReg="false" NextFile="libsymphonysearchx64.dll" DigSign="true"/>
<ROW File="it.pak" Component_="am.pak" FileName="it.pak" Attributes="0" SourcePath="..\..\dist\win-unpacked\locales\it.pak" SelfReg="false" NextFile="ja.pak"/>
<ROW File="ja.pak" Component_="am.pak" FileName="ja.pak" Attributes="0" SourcePath="..\..\dist\win-unpacked\locales\ja.pak" SelfReg="false" NextFile="kn.pak"/>
<ROW File="kn.pak" Component_="am.pak" FileName="kn.pak" Attributes="0" SourcePath="..\..\dist\win-unpacked\locales\kn.pak" SelfReg="false" NextFile="ko.pak"/>
<ROW File="ko.pak" Component_="am.pak" FileName="ko.pak" Attributes="0" SourcePath="..\..\dist\win-unpacked\locales\ko.pak" SelfReg="false" NextFile="lt.pak"/>
<ROW File="libEGL.dll" Component_="libEGL.dll" FileName="libEGL.dll" Attributes="0" SourcePath="..\..\dist\win-unpacked\libEGL.dll" SelfReg="false" NextFile="libGLESv2.dll"/>
<ROW File="libGLESv2.dll" Component_="libGLESv2.dll" FileName="LIBGLE~1.DLL|libGLESv2.dll" Attributes="0" SourcePath="..\..\dist\win-unpacked\libGLESv2.dll" SelfReg="false" NextFile="LICENSE.electron.txt"/>
<ROW File="libsymphonysearchx64.dll" Component_="libsymphonysearchx64.dll" FileName="LIBSYM~1.DLL|libsymphonysearch-x64.dll" Attributes="0" SourcePath="..\..\library\libsymphonysearch-x64.dll" SelfReg="false" NextFile="libsymphonysearchx86.dll"/>
<ROW File="libsymphonysearchx86.dll" Component_="libsymphonysearchx86.dll" FileName="LIBSYM~2.DLL|libsymphonysearch-x86.dll" Attributes="0" SourcePath="..\..\library\libsymphonysearch-x86.dll" SelfReg="false" NextFile="lz4winx64.exe"/>
<ROW File="libsymphonysearchx64.dll" Component_="libsymphonysearchx64.dll" FileName="LIBSYM~1.DLL|libsymphonysearch-x64.dll" Attributes="0" SourcePath="..\..\library\libsymphonysearch-x64.dll" SelfReg="false" NextFile="lz4winx64.exe"/>
<ROW File="lt.pak" Component_="am.pak" FileName="lt.pak" Attributes="0" SourcePath="..\..\dist\win-unpacked\locales\lt.pak" SelfReg="false" NextFile="lv.pak"/>
<ROW File="lv.pak" Component_="am.pak" FileName="lv.pak" Attributes="0" SourcePath="..\..\dist\win-unpacked\locales\lv.pak" SelfReg="false" NextFile="ml.pak"/>
<ROW File="lz4winx64.exe" Component_="lz4winx64.exe" FileName="LZ4-WI~1.EXE|lz4-win-x64.exe" Attributes="0" SourcePath="..\..\library\lz4-win-x64.exe" SelfReg="false" NextFile="lz4winx86.exe" DigSign="true"/>
<ROW File="lz4winx86.exe" Component_="lz4winx86.exe" FileName="LZ4-WI~2.EXE|lz4-win-x86.exe" Attributes="0" SourcePath="..\..\library\lz4-win-x86.exe" SelfReg="false" NextFile="tarwin.exe" DigSign="true"/>
<ROW File="lz4winx64.exe" Component_="lz4winx64.exe" FileName="LZ4-WI~1.EXE|lz4-win-x64.exe" Attributes="0" SourcePath="..\..\library\lz4-win-x64.exe" SelfReg="false" NextFile="tarwin.exe" DigSign="true"/>
<ROW File="ml.pak" Component_="am.pak" FileName="ml.pak" Attributes="0" SourcePath="..\..\dist\win-unpacked\locales\ml.pak" SelfReg="false" NextFile="mr.pak"/>
<ROW File="mr.pak" Component_="am.pak" FileName="mr.pak" Attributes="0" SourcePath="..\..\dist\win-unpacked\locales\mr.pak" SelfReg="false" NextFile="ms.pak"/>
<ROW File="ms.pak" Component_="am.pak" FileName="ms.pak" Attributes="0" SourcePath="..\..\dist\win-unpacked\locales\ms.pak" SelfReg="false" NextFile="nb.pak"/>
@ -279,7 +279,7 @@
<ROW File="sv.pak" Component_="am.pak" FileName="sv.pak" Attributes="0" SourcePath="..\..\dist\win-unpacked\locales\sv.pak" SelfReg="false" NextFile="sw.pak"/>
<ROW File="sw.pak" Component_="am.pak" FileName="sw.pak" Attributes="0" SourcePath="..\..\dist\win-unpacked\locales\sw.pak" SelfReg="false" NextFile="ta.pak"/>
<ROW File="ta.pak" Component_="am.pak" FileName="ta.pak" Attributes="0" SourcePath="..\..\dist\win-unpacked\locales\ta.pak" SelfReg="false" NextFile="te.pak"/>
<ROW File="tarwin.exe" Component_="tarwin.exe" FileName="tar-win.exe" Attributes="0" SourcePath="..\..\library\tar-win.exe" SelfReg="false" DigSign="true"/>
<ROW File="tarwin.exe" Component_="tarwin.exe" FileName="tar-win.exe" Attributes="0" SourcePath="..\..\library\tar-win.exe" SelfReg="false" NextFile="ClearOnBoot.exe" DigSign="true"/>
<ROW File="te.pak" Component_="am.pak" FileName="te.pak" Attributes="0" SourcePath="..\..\dist\win-unpacked\locales\te.pak" SelfReg="false" NextFile="th.pak"/>
<ROW File="th.pak" Component_="am.pak" FileName="th.pak" Attributes="0" SourcePath="..\..\dist\win-unpacked\locales\th.pak" SelfReg="false" NextFile="tr.pak"/>
<ROW File="tr.pak" Component_="am.pak" FileName="tr.pak" Attributes="0" SourcePath="..\..\dist\win-unpacked\locales\tr.pak" SelfReg="false" NextFile="uk.pak"/>

View File

@ -72,6 +72,9 @@
<COMPONENT cid="caphyon.advinst.msicomp.MsiCompsComponent">
<ROW Component="AI_CustomARPName" ComponentId="{2817ACD9-F494-4729-9830-111EF3311CFA}" Directory_="APPDIR" Attributes="4" KeyPath="DisplayName" Options="1"/>
<ROW Component="AI_DisableModify" ComponentId="{DA4E8013-2F4B-493A-90A8-BD729DA7EE2C}" Directory_="APPDIR" Attributes="260" KeyPath="NoModify" Options="1"/>
<ROW Component="ClearOnBoot.exe" ComponentId="{A76E92B6-D0FB-46CF-A1B6-FB377628776A}" Directory_="library_Dir" Attributes="0" KeyPath="ClearOnBoot.exe"/>
<ROW Component="ClearSchTasks.exe" ComponentId="{4332B7D5-8F8D-4976-AB22-A9A44D66EC0F}" Directory_="library_Dir" Attributes="0" KeyPath="ClearSchTasks.exe"/>
<ROW Component="FreeDiskSpace.exe" ComponentId="{4E26F0FD-6460-4D2F-9952-E0A6109E5868}" Directory_="library_Dir" Attributes="0" KeyPath="FreeDiskSpace.exe"/>
<ROW Component="Jobber.exe" ComponentId="{18CDCF68-578C-4E54-BC47-B1295CFCA12C}" Directory_="jobber_Dir" Attributes="0" KeyPath="Jobber.exe"/>
<ROW Component="PodUrl" ComponentId="{EA80D82D-BC65-4075-A9A8-F53E2B2513CE}" Directory_="APPDIR" Attributes="260" KeyPath="PodUrl"/>
<ROW Component="ProductInformation" ComponentId="{8B92B687-8AE0-4A5C-B6AB-5D1854009CEA}" Directory_="APPDIR" Attributes="4" KeyPath="Version"/>
@ -127,14 +130,10 @@
<ROW Component="ffmpeg.dll" ComponentId="{6ECB1C9B-C14D-4224-A048-D2C4666426DC}" Directory_="APPDIR" Attributes="0" KeyPath="ffmpeg.dll"/>
<ROW Component="index.d.ts" ComponentId="{72BA6CA0-6244-4A31-9C40-642ADC0D521E}" Directory_="src_Dir" Attributes="0" KeyPath="index.d.ts" Type="0"/>
<ROW Component="index.js" ComponentId="{101B112A-2663-4FC5-9972-1FE73CECADBC}" Directory_="lib_Dir" Attributes="0" KeyPath="index.js" Type="0"/>
<ROW Component="indexvalidator.exec" ComponentId="{B1BC0EF5-AFD3-452F-9956-DDA7DF0D9F9D}" Directory_="library_Dir" Attributes="0" KeyPath="indexvalidator.exec" Type="0"/>
<ROW Component="indexvalidatorx64.exe" ComponentId="{6577C4DE-AAE3-456E-B05B-34A705065268}" Directory_="library_Dir" Attributes="256" KeyPath="indexvalidatorx64.exe"/>
<ROW Component="indexvalidatorx86.exe" ComponentId="{173E5F1C-C2AF-48A4-8D6C-7A68B79D45E0}" Directory_="library_Dir" Attributes="0" KeyPath="indexvalidatorx86.exe"/>
<ROW Component="libEGL.dll" ComponentId="{4FA3C90D-C473-4484-B884-1A32AD9DE4D7}" Directory_="APPDIR" Attributes="0" KeyPath="libEGL.dll"/>
<ROW Component="libGLESv2.dll" ComponentId="{06513829-1D3E-4286-BB01-112BF26E6684}" Directory_="APPDIR" Attributes="0" KeyPath="libGLESv2.dll"/>
<ROW Component="libsymphonysearchx64.dll" ComponentId="{CE716A0B-FB01-4FE7-BB7C-FE292064D478}" Directory_="library_Dir" Attributes="256" KeyPath="libsymphonysearchx64.dll"/>
<ROW Component="libsymphonysearchx86.dll" ComponentId="{0FE8E551-95CE-4936-8553-217ED411CAD5}" Directory_="library_Dir" Attributes="0" KeyPath="libsymphonysearchx86.dll"/>
<ROW Component="lz4winx64.exe" ComponentId="{A6737531-D9E4-4AC8-990E-14CD3D096B6A}" Directory_="library_Dir" Attributes="256" KeyPath="lz4winx64.exe"/>
<ROW Component="lz4winx86.exe" ComponentId="{C71364D8-6FE2-4BA1-8D89-12B075FFAEFD}" Directory_="library_Dir" Attributes="0" KeyPath="lz4winx86.exe"/>
<ROW Component="msvcp140.dll" ComponentId="{682E2128-C1F2-48F3-97C6-8A5F60BE05C6}" Directory_="APPDIR" Attributes="0" KeyPath="msvcp140.dll"/>
<ROW Component="node.dll" ComponentId="{F6DDB184-1DFB-4F17-BC45-55AC9C98A40B}" Directory_="APPDIR" Attributes="0" KeyPath="node.dll"/>
@ -145,12 +144,15 @@
</COMPONENT>
<COMPONENT cid="caphyon.advinst.msicomp.MsiFeatsComponent">
<ROW Feature="D564007E3BBE4F85950A09B470A7CA65" Title="Visual C++ Redistributable for Visual Studio 2013 x86" Description="Visual C++ Redistributable for Visual Studio 2013 x86" Display="3" Level="1" Attributes="0"/>
<ROW Feature="MainFeature" Title="MainFeature" Description="Description" Display="1" Level="1" Directory_="APPDIR" Attributes="0" Components="AI_CustomARPName AI_DisableModify Jobber.exe PodUrl ProductInformation Symphony Symphony.config Symphony.exe am.pak ambient.d.ts apimswincoreconsolel110.dll apimswincoredatetimel110.dll apimswincoredebugl110.dll apimswincoreerrorhandlingl110.dll apimswincorefilel110.dll apimswincorefilel120.dll apimswincorefilel210.dll apimswincorehandlel110.dll apimswincoreheapl110.dll apimswincoreinterlockedl110.dll apimswincorelibraryloaderl110.dll apimswincorelocalizationl120.dll apimswincorememoryl110.dll apimswincorenamedpipel110.dll apimswincoreprocessenvironmentl110.dll apimswincoreprocessthreadsl110.dll apimswincoreprocessthreadsl111.dll apimswincoreprofilel110.dll apimswincorertlsupportl110.dll apimswincorestringl110.dll apimswincoresynchl110.dll apimswincoresynchl120.dll apimswincoresysinfol110.dll apimswincoretimezonel110.dll apimswincoreutill110.dll apimswincrtconiol110.dll apimswincrtconvertl110.dll apimswincrtenvironmentl110.dll apimswincrtfilesysteml110.dll apimswincrtheapl110.dll apimswincrtlocalel110.dll apimswincrtmathl110.dll apimswincrtmultibytel110.dll apimswincrtprivatel110.dll apimswincrtprocessl110.dll apimswincrtruntimel110.dll apimswincrtstdiol110.dll apimswincrtstringl110.dll apimswincrttimel110.dll apimswincrtutilityl110.dll appupdate.yml blink_image_resources_200_percent.pak cld.node d3dcompiler_47.dll ffmpeg.dll index.d.ts index.js indexvalidator.exec indexvalidatorx64.exe indexvalidatorx86.exe libEGL.dll libGLESv2.dll libsymphonysearchx64.dll libsymphonysearchx86.dll lz4winx64.exe lz4winx86.exe msvcp140.dll node.dll npmignore tarwin.exe ucrtbase.dll vcruntime140.dll"/>
<ROW Feature="MainFeature" Title="MainFeature" Description="Description" Display="1" Level="1" Directory_="APPDIR" Attributes="0" Components="AI_CustomARPName AI_DisableModify ClearOnBoot.exe ClearSchTasks.exe FreeDiskSpace.exe Jobber.exe PodUrl ProductInformation Symphony Symphony.config Symphony.exe am.pak ambient.d.ts apimswincoreconsolel110.dll apimswincoredatetimel110.dll apimswincoredebugl110.dll apimswincoreerrorhandlingl110.dll apimswincorefilel110.dll apimswincorefilel120.dll apimswincorefilel210.dll apimswincorehandlel110.dll apimswincoreheapl110.dll apimswincoreinterlockedl110.dll apimswincorelibraryloaderl110.dll apimswincorelocalizationl120.dll apimswincorememoryl110.dll apimswincorenamedpipel110.dll apimswincoreprocessenvironmentl110.dll apimswincoreprocessthreadsl110.dll apimswincoreprocessthreadsl111.dll apimswincoreprofilel110.dll apimswincorertlsupportl110.dll apimswincorestringl110.dll apimswincoresynchl110.dll apimswincoresynchl120.dll apimswincoresysinfol110.dll apimswincoretimezonel110.dll apimswincoreutill110.dll apimswincrtconiol110.dll apimswincrtconvertl110.dll apimswincrtenvironmentl110.dll apimswincrtfilesysteml110.dll apimswincrtheapl110.dll apimswincrtlocalel110.dll apimswincrtmathl110.dll apimswincrtmultibytel110.dll apimswincrtprivatel110.dll apimswincrtprocessl110.dll apimswincrtruntimel110.dll apimswincrtstdiol110.dll apimswincrtstringl110.dll apimswincrttimel110.dll apimswincrtutilityl110.dll appupdate.yml blink_image_resources_200_percent.pak cld.node d3dcompiler_47.dll ffmpeg.dll index.d.ts index.js indexvalidatorx86.exe libEGL.dll libGLESv2.dll libsymphonysearchx86.dll lz4winx86.exe msvcp140.dll node.dll npmignore tarwin.exe ucrtbase.dll vcruntime140.dll"/>
<ATTRIBUTE name="CurrentFeature" value="MainFeature"/>
</COMPONENT>
<COMPONENT cid="caphyon.advinst.msicomp.MsiFilesComponent">
<ROW File="CODE_OF_CONDUCT.md" Component_="npmignore" FileName="CODE_O~1.MD|CODE_OF_CONDUCT.md" Attributes="0" SourcePath="..\..\dist\win-ia32-unpacked\resources\app.asar.unpacked\node_modules\spawn-rx\CODE_OF_CONDUCT.md" SelfReg="false" NextFile="COPYING"/>
<ROW File="COPYING" Component_="npmignore" FileName="COPYING" Attributes="0" SourcePath="..\..\dist\win-ia32-unpacked\resources\app.asar.unpacked\node_modules\spawn-rx\COPYING" SelfReg="false" NextFile="esdoc.json"/>
<ROW File="ClearOnBoot.exe" Component_="ClearOnBoot.exe" FileName="CLEARO~1.EXE|ClearOnBoot.exe" Attributes="0" SourcePath="..\..\node_modules\electron-utils\ClearOnBoot\bin\Release\ClearOnBoot.exe" SelfReg="false" NextFile="ClearSchTasks.exe" DigSign="true"/>
<ROW File="ClearSchTasks.exe" Component_="ClearSchTasks.exe" FileName="CLEARS~1.EXE|ClearSchTasks.exe" Attributes="0" SourcePath="..\..\node_modules\electron-utils\ClearSchTasks\bin\Release\ClearSchTasks.exe" SelfReg="false" NextFile="FreeDiskSpace.exe" DigSign="true"/>
<ROW File="FreeDiskSpace.exe" Component_="FreeDiskSpace.exe" FileName="FREEDI~1.EXE|FreeDiskSpace.exe" Attributes="0" SourcePath="..\..\node_modules\electron-utils\FreeDiskSpace\bin\Release\FreeDiskSpace.exe" SelfReg="false" DigSign="true"/>
<ROW File="Jobber.exe" Component_="Jobber.exe" FileName="Jobber.exe" Attributes="0" SourcePath="..\..\dist\win-ia32-unpacked\resources\app.asar.unpacked\node_modules\spawn-rx\vendor\jobber\Jobber.exe" SelfReg="false" NextFile="electron.asar" DigSign="true"/>
<ROW File="LICENSE.electron.txt" Component_="blink_image_resources_200_percent.pak" FileName="LICENS~1.TXT|LICENSE.electron.txt" Attributes="0" SourcePath="..\..\dist\win-ia32-unpacked\LICENSE.electron.txt" SelfReg="false" NextFile="LICENSES.chromium.html"/>
<ROW File="LICENSES.chromium.html" Component_="blink_image_resources_200_percent.pak" FileName="LICENS~1.HTM|LICENSES.chromium.html" Attributes="0" SourcePath="..\..\dist\win-ia32-unpacked\LICENSES.chromium.html" SelfReg="false" NextFile="msvcp140.dll"/>
@ -215,7 +217,7 @@
<ROW File="da.pak" Component_="am.pak" FileName="da.pak" Attributes="0" SourcePath="..\..\dist\win-ia32-unpacked\locales\da.pak" SelfReg="false" NextFile="de.pak"/>
<ROW File="de.pak" Component_="am.pak" FileName="de.pak" Attributes="0" SourcePath="..\..\dist\win-ia32-unpacked\locales\de.pak" SelfReg="false" NextFile="el.pak"/>
<ROW File="el.pak" Component_="am.pak" FileName="el.pak" Attributes="0" SourcePath="..\..\dist\win-ia32-unpacked\locales\el.pak" SelfReg="false" NextFile="enGB.pak"/>
<ROW File="electron.asar" Component_="appupdate.yml" FileName="ELECTR~1.ASA|electron.asar" Attributes="0" SourcePath="..\..\dist\win-ia32-unpacked\resources\electron.asar" SelfReg="false" NextFile="indexvalidatorx64.exe"/>
<ROW File="electron.asar" Component_="appupdate.yml" FileName="ELECTR~1.ASA|electron.asar" Attributes="0" SourcePath="..\..\dist\win-ia32-unpacked\resources\electron.asar" SelfReg="false" NextFile="indexvalidatorx86.exe"/>
<ROW File="enGB.pak" Component_="am.pak" FileName="en-GB.pak" Attributes="0" SourcePath="..\..\dist\win-ia32-unpacked\locales\en-GB.pak" SelfReg="false" NextFile="enUS.pak"/>
<ROW File="enUS.pak" Component_="am.pak" FileName="en-US.pak" Attributes="0" SourcePath="..\..\dist\win-ia32-unpacked\locales\en-US.pak" SelfReg="false" NextFile="es419.pak"/>
<ROW File="es.pak" Component_="am.pak" FileName="es.pak" Attributes="0" SourcePath="..\..\dist\win-ia32-unpacked\locales\es.pak" SelfReg="false" NextFile="et.pak"/>
@ -240,23 +242,17 @@
<ROW File="index.js.map" Component_="index.d.ts" FileName="INDEXJ~1.MAP|index.js.map" Attributes="0" SourcePath="..\..\dist\win-ia32-unpacked\resources\app.asar.unpacked\node_modules\spawn-rx\lib\src\index.js.map" SelfReg="false" NextFile="package.json"/>
<ROW File="index.js_1" Component_="index.d.ts" FileName="index.js" Attributes="0" SourcePath="..\..\dist\win-ia32-unpacked\resources\app.asar.unpacked\node_modules\spawn-rx\lib\src\index.js" SelfReg="false" NextFile="index.js.map"/>
<ROW File="index.ts" Component_="ambient.d.ts" FileName="index.ts" Attributes="0" SourcePath="..\..\dist\win-ia32-unpacked\resources\app.asar.unpacked\node_modules\spawn-rx\src\index.ts" SelfReg="false" NextFile="tsconfig.json"/>
<ROW File="indexvalidator.exec" Component_="indexvalidator.exec" FileName="INDEXV~3.EXE|indexvalidator.exec" Attributes="0" SourcePath="..\..\library\indexvalidator.exec" SelfReg="false" NextFile="libsymphonysearchx64.dll"/>
<ROW File="indexvalidatorx64.exe" Component_="indexvalidatorx64.exe" FileName="INDEXV~1.EXE|indexvalidator-x64.exe" Attributes="0" SourcePath="..\..\library\indexvalidator-x64.exe" SelfReg="false" NextFile="indexvalidatorx86.exe" DigSign="true"/>
<ROW File="indexvalidatorx86.exe" Component_="indexvalidatorx86.exe" FileName="INDEXV~2.EXE|indexvalidator-x86.exe" Attributes="0" SourcePath="..\..\library\indexvalidator-x86.exe" SelfReg="false" NextFile="indexvalidator.exec" DigSign="true"/>
<ROW File="indexvalidatorx86.exe" Component_="indexvalidatorx86.exe" FileName="INDEXV~2.EXE|indexvalidator-x86.exe" Attributes="0" SourcePath="..\..\library\indexvalidator-x86.exe" SelfReg="false" NextFile="libsymphonysearchx86.dll" DigSign="true"/>
<ROW File="it.pak" Component_="am.pak" FileName="it.pak" Attributes="0" SourcePath="..\..\dist\win-ia32-unpacked\locales\it.pak" SelfReg="false" NextFile="ja.pak"/>
<ROW File="ja.pak" Component_="am.pak" FileName="ja.pak" Attributes="0" SourcePath="..\..\dist\win-ia32-unpacked\locales\ja.pak" SelfReg="false" NextFile="kn.pak"/>
<ROW File="kn.pak" Component_="am.pak" FileName="kn.pak" Attributes="0" SourcePath="..\..\dist\win-ia32-unpacked\locales\kn.pak" SelfReg="false" NextFile="ko.pak"/>
<ROW File="ko.pak" Component_="am.pak" FileName="ko.pak" Attributes="0" SourcePath="..\..\dist\win-ia32-unpacked\locales\ko.pak" SelfReg="false" NextFile="lt.pak"/>
<ROW File="libEGL.dll" Component_="libEGL.dll" FileName="libEGL.dll" Attributes="0" SourcePath="..\..\dist\win-ia32-unpacked\libEGL.dll" SelfReg="false" NextFile="libGLESv2.dll"/>
<ROW File="libGLESv2.dll" Component_="libGLESv2.dll" FileName="LIBGLE~1.DLL|libGLESv2.dll" Attributes="0" SourcePath="..\..\dist\win-ia32-unpacked\libGLESv2.dll" SelfReg="false" NextFile="LICENSE.electron.txt"/>
<ROW File="libsymphonysearch.dylib" Component_="indexvalidator.exec" FileName="LIBSYM~1.DYL|libsymphonysearch.dylib" Attributes="0" SourcePath="..\..\library\libsymphonysearch.dylib" SelfReg="false" NextFile="lz4winx64.exe"/>
<ROW File="libsymphonysearchx64.dll" Component_="libsymphonysearchx64.dll" FileName="LIBSYM~1.DLL|libsymphonysearch-x64.dll" Attributes="0" SourcePath="..\..\library\libsymphonysearch-x64.dll" SelfReg="false" NextFile="libsymphonysearchx86.dll"/>
<ROW File="libsymphonysearchx86.dll" Component_="libsymphonysearchx86.dll" FileName="LIBSYM~2.DLL|libsymphonysearch-x86.dll" Attributes="0" SourcePath="..\..\library\libsymphonysearch-x86.dll" SelfReg="false" NextFile="libsymphonysearch.dylib"/>
<ROW File="libsymphonysearchx86.dll" Component_="libsymphonysearchx86.dll" FileName="LIBSYM~2.DLL|libsymphonysearch-x86.dll" Attributes="0" SourcePath="..\..\library\libsymphonysearch-x86.dll" SelfReg="false" NextFile="lz4winx86.exe"/>
<ROW File="lt.pak" Component_="am.pak" FileName="lt.pak" Attributes="0" SourcePath="..\..\dist\win-ia32-unpacked\locales\lt.pak" SelfReg="false" NextFile="lv.pak"/>
<ROW File="lv.pak" Component_="am.pak" FileName="lv.pak" Attributes="0" SourcePath="..\..\dist\win-ia32-unpacked\locales\lv.pak" SelfReg="false" NextFile="ml.pak"/>
<ROW File="lz4.exec" Component_="indexvalidator.exec" FileName="LZ4~1.EXE|lz4.exec" Attributes="0" SourcePath="..\..\library\lz4.exec" SelfReg="false" NextFile="tarwin.exe"/>
<ROW File="lz4winx64.exe" Component_="lz4winx64.exe" FileName="LZ4-WI~1.EXE|lz4-win-x64.exe" Attributes="0" SourcePath="..\..\library\lz4-win-x64.exe" SelfReg="false" NextFile="lz4winx86.exe" DigSign="true"/>
<ROW File="lz4winx86.exe" Component_="lz4winx86.exe" FileName="LZ4-WI~2.EXE|lz4-win-x86.exe" Attributes="0" SourcePath="..\..\library\lz4-win-x86.exe" SelfReg="false" NextFile="lz4.exec" DigSign="true"/>
<ROW File="lz4winx86.exe" Component_="lz4winx86.exe" FileName="LZ4-WI~2.EXE|lz4-win-x86.exe" Attributes="0" SourcePath="..\..\library\lz4-win-x86.exe" SelfReg="false" NextFile="tarwin.exe" DigSign="true"/>
<ROW File="ml.pak" Component_="am.pak" FileName="ml.pak" Attributes="0" SourcePath="..\..\dist\win-ia32-unpacked\locales\ml.pak" SelfReg="false" NextFile="mr.pak"/>
<ROW File="mr.pak" Component_="am.pak" FileName="mr.pak" Attributes="0" SourcePath="..\..\dist\win-ia32-unpacked\locales\mr.pak" SelfReg="false" NextFile="ms.pak"/>
<ROW File="ms.pak" Component_="am.pak" FileName="ms.pak" Attributes="0" SourcePath="..\..\dist\win-ia32-unpacked\locales\ms.pak" SelfReg="false" NextFile="nb.pak"/>
@ -280,7 +276,7 @@
<ROW File="sv.pak" Component_="am.pak" FileName="sv.pak" Attributes="0" SourcePath="..\..\dist\win-ia32-unpacked\locales\sv.pak" SelfReg="false" NextFile="sw.pak"/>
<ROW File="sw.pak" Component_="am.pak" FileName="sw.pak" Attributes="0" SourcePath="..\..\dist\win-ia32-unpacked\locales\sw.pak" SelfReg="false" NextFile="ta.pak"/>
<ROW File="ta.pak" Component_="am.pak" FileName="ta.pak" Attributes="0" SourcePath="..\..\dist\win-ia32-unpacked\locales\ta.pak" SelfReg="false" NextFile="te.pak"/>
<ROW File="tarwin.exe" Component_="tarwin.exe" FileName="tar-win.exe" Attributes="0" SourcePath="..\..\library\tar-win.exe" SelfReg="false" DigSign="true"/>
<ROW File="tarwin.exe" Component_="tarwin.exe" FileName="tar-win.exe" Attributes="0" SourcePath="..\..\library\tar-win.exe" SelfReg="false" NextFile="ClearOnBoot.exe" DigSign="true"/>
<ROW File="te.pak" Component_="am.pak" FileName="te.pak" Attributes="0" SourcePath="..\..\dist\win-ia32-unpacked\locales\te.pak" SelfReg="false" NextFile="th.pak"/>
<ROW File="th.pak" Component_="am.pak" FileName="th.pak" Attributes="0" SourcePath="..\..\dist\win-ia32-unpacked\locales\th.pak" SelfReg="false" NextFile="tr.pak"/>
<ROW File="tr.pak" Component_="am.pak" FileName="tr.pak" Attributes="0" SourcePath="..\..\dist\win-ia32-unpacked\locales\tr.pak" SelfReg="false" NextFile="uk.pak"/>

View File

@ -10,6 +10,7 @@ const makeBoundTimedCollector = require('./queue');
const searchConfig = require('./searchConfig');
const log = require('../log.js');
const logLevels = require('../enums/logLevels.js');
const { launchAgent, launchDaemon, taskScheduler } = require('./utils/search-launchd.js');
const libSymphonySearch = require('./searchLibrary');
const Crypto = require('../cryptoLib');
@ -34,6 +35,7 @@ class Search {
this.messageData = [];
this.isRealTimeIndexing = false;
this.crypto = new Crypto(userId, key);
initializeLaunchAgent();
this.decryptAndInit();
this.collector = makeBoundTimedCollector(this.checkIsRealTimeIndexing.bind(this),
searchConfig.REAL_TIME_INDEXING_TIME, this.realTimeIndexing.bind(this));
@ -594,6 +596,78 @@ function readFile(batch) {
});
}
/**
* Creating launch agent for handling the deletion of
* index data folder when app crashed or on boot up
*/
function initializeLaunchAgent() {
let pidValue = process.pid;
if (isMac) {
createLaunchScript(pidValue, 'clear-data', searchConfig.LIBRARY_CONSTANTS.LAUNCH_AGENT_FILE, function (res) {
if (!res) {
log.send(logLevels.ERROR, `Launch Agent not created`);
}
createLaunchScript(null, 'clear-data-boot', searchConfig.LIBRARY_CONSTANTS.LAUNCH_DAEMON_FILE, function (result) {
if (!result) {
log.send(logLevels.ERROR, `Launch Agent not created`);
}
launchDaemon(`${searchConfig.FOLDERS_CONSTANTS.USER_DATA_PATH}/.symphony/clear-data-boot.sh`, function (data) {
if (data) {
log.send(logLevels.INFO, 'Launch Daemon: Creating successful');
}
});
});
launchAgent(pidValue, `${searchConfig.FOLDERS_CONSTANTS.USER_DATA_PATH}/.symphony/clear-data.sh`, function (response) {
if (response) {
log.send(logLevels.INFO, 'Launch Agent: Creating successful');
}
});
});
} else {
let folderPath = isDevEnv ? path.join(__dirname, '..', '..', searchConfig.FOLDERS_CONSTANTS.INDEX_FOLDER_NAME) :
path.join(searchConfig.FOLDERS_CONSTANTS.USER_DATA_PATH, searchConfig.FOLDERS_CONSTANTS.INDEX_FOLDER_NAME);
taskScheduler(`${searchConfig.LIBRARY_CONSTANTS.WINDOWS_TASK_FILE}`, folderPath, pidValue, `${searchConfig.LIBRARY_CONSTANTS.WINDOWS_CLEAR_SCRIPT}`);
}
}
/**
* Passing the pid of the application and creating the
* bash file in the userData folder
* @param pid
* @param name
* @param scriptPath
* @param cb
*/
function createLaunchScript(pid, name, scriptPath, cb) {
if (!fs.existsSync(`${searchConfig.FOLDERS_CONSTANTS.USER_DATA_PATH}/.symphony/`)) {
fs.mkdirSync(`${searchConfig.FOLDERS_CONSTANTS.USER_DATA_PATH}/.symphony/`);
}
fs.readFile(scriptPath, 'utf8', function (err, data) {
if (err) {
log.send(logLevels.ERROR, `Error reading sh file: ${err}`);
cb(false);
return;
}
let result = data;
result = result.replace(/dataPath/g, `"${searchConfig.FOLDERS_CONSTANTS.USER_DATA_PATH}/${searchConfig.FOLDERS_CONSTANTS.INDEX_FOLDER_NAME}"`);
result = result.replace(/scriptPath/g, `${searchConfig.FOLDERS_CONSTANTS.USER_DATA_PATH}/.symphony/${name}.sh`);
if (pid) {
result = result.replace(/SymphonyPID/g, `${pid}`);
}
fs.writeFile(`${searchConfig.FOLDERS_CONSTANTS.USER_DATA_PATH}/.symphony/${name}.sh`, result, 'utf8', function (error) {
if (error) {
log.send(logLevels.ERROR, `Error writing sh file: ${error}`);
return cb(false);
}
return cb(true);
});
});
}
/**
* Exporting the search library
* @type {{Search: Search}}

View File

@ -26,12 +26,25 @@ const libraryPath = isMac ? path.join(macLibraryPath, 'libsymphonysearch.dylib')
const userConfigFileName = 'search_users_config.json';
const userConfigFile = isDevEnv ? path.join(__dirname, '..', '..', userConfigFileName) : path.join(userData, userConfigFileName);
const libraryFolderPath = isMac ? macLibraryPath : winLibraryPath;
const pathToUtils = isDevEnv ? path.join(__dirname, '../../node_modules/electron-utils') : winLibraryPath;
const launchAgentFile = path.join(libraryFolderPath, 'search-launch-agent.sh');
const launchDaemonFile = path.join(libraryFolderPath, 'search-launch-daemon.sh');
const windowsTaskFile = path.join(pathToUtils, isDevEnv ? 'ClearSchTasks/bin/Release/ClearSchTasks.exe' : 'ClearSchTasks.exe');
const windowsClearScript = path.join(pathToUtils, isDevEnv ? 'ClearOnBoot/bin/Release/ClearOnBoot.exe' : 'ClearOnBoot.exe');
const libraryPaths = {
INDEX_VALIDATOR: indexValidatorPath,
LZ4_PATH: lz4Path,
MAC_LIBRARY_FOLDER: macLibraryPath,
WIN_LIBRARY_FOLDER: winLibraryPath,
SEARCH_LIBRARY_PATH: libraryPath
SEARCH_LIBRARY_PATH: libraryPath,
LIBRARY_FOLDER_PATH: libraryFolderPath,
LAUNCH_AGENT_FILE: launchAgentFile,
LAUNCH_DAEMON_FILE: launchDaemonFile,
WINDOWS_TASK_FILE: windowsTaskFile,
WINDOWS_CLEAR_SCRIPT: windowsClearScript,
};
const folderPaths = {

View File

@ -0,0 +1,105 @@
const { exec, execSync } = require('child_process');
const os = require('os');
const { randomString } = require('./randomString.js');
const log = require('../../log.js');
const logLevels = require('../../enums/logLevels.js');
const Winreg = require('winreg');
/**
* Register for creating launch agent
* @type {Registry}
*/
const regKey = new Winreg({
hive: Winreg.HKCU,
key: '\\Software\\Microsoft\\Windows\\CurrentVersion\\Run'
});
/**
* Clears the data folder on app crash
* @param pid
* @param script
* @param cb (callback)
*/
function launchAgent(pid, script, cb) {
exec(`sh "${script}" true ${pid}`, (error, stdout, stderr) => {
if (error) {
log.send(logLevels.ERROR, `Lanuchd: Error creating script ${error}`);
return cb(false);
}
if (stderr) {
log.send(logLevels.ERROR, `Lanuchd: Error creating script ${stderr}`);
}
return cb(true);
});
}
/**
* Clears the data folder on boot
* @param script
* @param cb (callback)
*/
function launchDaemon(script, cb) {
exec(`sh "${script}" true`, (error, stdout, stderr) => {
if (error) {
log.send(logLevels.ERROR, `Lanuchd: Error creating script ${error}`);
return cb(false);
}
if (stderr) {
log.send(logLevels.ERROR, `Lanuchd: Error creating script ${stderr}`);
}
return cb(true);
});
}
/**
* Windows clears the data folder on app crash
* @param script
* @param dataFolder
* @param pid
* @param clearScript
*/
function taskScheduler(script, dataFolder, pid, clearScript) {
let userName;
if (os.userInfo) {
userName = os.userInfo().username;
} else {
try {
userName = execSync('whoami').toString().replace(/^.*\\/, '');
} catch (e) {
log.send(logLevels.WARN, `whoami failed (using randomString): ${e}`);
userName = randomString();
}
}
exec(`SCHTASKS /Create /SC MINUTE /TN "SymphonyTask${userName}" /TR "'${script}' '${dataFolder}' 'SymphonyTask${userName}' '${pid}'" /F`, (error, stdout, stderr) => {
if (error) {
log.send(logLevels.ERROR, `Lanuchd: Error creating task ${error}`);
}
if (stderr) {
log.send(logLevels.WARN, `Lanuchd: Error creating task ${stderr}`);
}
log.send(logLevels.INFO, `Lanuchd: Creating task successful ${stdout}`);
});
winRegScript(userName, clearScript, dataFolder);
}
/**
* Clear the data folder on user login for first time
* @param userName
* @param script
* @param dataFolder
*/
function winRegScript(userName, script, dataFolder) {
regKey.set(`SymphonyTask-${userName}`, Winreg.REG_SZ, `"${script}" "${dataFolder}"`, function(err) {
if (err !== null) {
log.send(logLevels.INFO, `winReg: Creating task failed ${err}`);
}
log.send(logLevels.INFO, 'winReg: Creating task successful');
});
}
module.exports = {
launchAgent,
launchDaemon,
taskScheduler
};

View File

@ -0,0 +1,44 @@
#!/usr/bin/env bash
pid=$2
launchDir=~/Library/LaunchAgents/
if $1; then
if [ ! -d "$launchDir" ]; then
mkdir "$launchDir"
fi
launchctl unload ~/Library/LaunchAgents/com.symphony-search.data.plist
cat > ~/Library/LaunchAgents/com.symphony-search.data.plist << EOT
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.symphony-search.data.agent</string>
<key>ProgramArguments</key>
<array>
<string>/bin/sh</string>
<string>scriptPath</string>
<string>false</string>
<string>SymphonyPID</string>
</array>
<key>RunAtLoad</key>
<false/>
<key>StartInterval</key>
<integer>60</integer>
<key>StandardOutPath</key>
<string>/dev/null</string>
<key>StandardErrorPath</key>
<string>/dev/null</string>
</dict>
</plist>
EOT
launchctl load ~/Library/LaunchAgents/com.symphony-search.data.plist
elif ps -p $pid > /dev/null
then
echo true
else
echo false
rm -rf dataPath
launchctl unload ~/Library/LaunchAgents/com.symphony-search.data.plist
rm -rf ~/Library/LaunchAgents/com.symphony-search.data.plist
fi

View File

@ -0,0 +1,35 @@
#!/usr/bin/env bash
launchDir=~/Library/LaunchAgents/
if $1; then
if [ ! -d "$launchDir" ]; then
mkdir "$launchDir"
fi
cat > ~/Library/LaunchAgents/com.symphony-search.clear.plist << EOT
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.symphony-search.clear.daemon</string>
<key>ProgramArguments</key>
<array>
<string>/bin/sh</string>
<string>scriptPath</string>
<string>false</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>KeepAlive</key>
<false/>
<key>StandardOutPath</key>
<string>/dev/null</string>
<key>StandardErrorPath</key>
<string>/dev/null</string>
</dict>
</plist>
EOT
else
rm -rf dataPath
fi

View File

@ -44,7 +44,9 @@
"config/Symphony.config",
"library/libsymphonysearch.dylib",
"library/indexvalidator.exec",
"library/lz4.exec"
"library/lz4.exec",
"library/search-launch-agent.sh",
"library/search-launch-daemon.sh"
],
"appId": "symphony-electron-desktop",
"mac": {
@ -124,6 +126,7 @@
"winreg": "1.2.4"
},
"optionalDependencies": {
"screen-snippet": "git+https://github.com/symphonyoss/ScreenSnippet.git#v1.0.1"
"screen-snippet": "git+https://github.com/symphonyoss/ScreenSnippet.git#v1.0.1",
"electron-utils": "git+https://github.com/symphonyoss/electron-utils.git#v1.0.5"
}
}

View File

@ -11,11 +11,16 @@ let SearchApi;
jest.mock('electron', function() {
return {
app: {
getPath: mockedGetPath
getPath: mockedGetPath,
getName: mockedGetName
}
}
});
function mockedGetName() {
return 'Symphony';
}
function mockedGetPath(type) {
if (type === 'exe') {
return executionPath;
@ -34,6 +39,7 @@ describe('Tests for Search', function() {
let dataFolderPath;
let realTimeIndexPath;
let tempBatchPath;
let launchAgent;
let currentDate = new Date().getTime();
jasmine.DEFAULT_TIMEOUT_INTERVAL = 60000;
@ -51,12 +57,12 @@ describe('Tests for Search', function() {
searchConfig = require('../js/search/searchConfig.js');
const { Search } = require('../js/search/search.js');
SearchApi = new Search(userId, key);
launchAgent = require('../js/search/utils/search-launchd.js');
realTimeIndexPath = path.join(userConfigDir, 'data', 'temp_realtime_index');
tempBatchPath = path.join(userConfigDir, 'data', 'temp_batch_indexes');
dataFolderPath = path.join(userConfigDir, 'data');
if (fs.existsSync(dataFolderPath)) {
deleteIndexFolders(dataFolderPath)
deleteIndexFolders(dataFolderPath);
}
done();
});
@ -69,7 +75,10 @@ describe('Tests for Search', function() {
if (fs.existsSync(root)) {
fs.unlinkSync(root);
}
let script = `${searchConfig.FOLDERS_CONSTANTS.USER_DATA_PATH}/.symphony`;
if (fs.existsSync(script)) {
deleteIndexFolders(script);
}
done();
}, 3000);
});