-
Notifications
You must be signed in to change notification settings - Fork 0
/
Mespotine_Dependency_Checker_Function.lua
65 lines (55 loc) · 2.41 KB
/
Mespotine_Dependency_Checker_Function.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
reaper.JS_ReaScriptAPI_Version=nil
reaper.CF_GetSWSVersion=nil
--reaper.osara_outputMessage=nil
--reaper.ReaPack_BrowsePackages=nil
function CheckForDependencies(ReaImGui, js_ReaScript, US_API, SWS, Osara)
if US_API==true or js_ReaScript==true or ReaImGui==true or SWS==true or Osara==true then
if US_API==true and reaper.file_exists(reaper.GetResourcePath().."/UserPlugins/ultraschall_api.lua")==false then
US_API="Ultraschall API" -- "Ultraschall API" or ""
else
US_API=""
end
if reaper.JS_ReaScriptAPI_Version==nil and js_ReaScript==true then
js_ReaScript="js_ReaScript" -- "js_ReaScript" or ""
else
js_ReaScript=""
end
if reaper.ImGui_GetVersion==nil and ReaImGui==true then
ReaImGui="ReaImGui" -- "ReaImGui" or ""
else
ReaImGui=""
end
if reaper.CF_GetSWSVersion==nil and SWS==true then
SWS="SWS" -- "ReaImGui" or ""
else
SWS=""
end
if reaper.osara_outputMessage==nil and Osara==true then
Osara="Osara" -- "ReaImGui" or ""
else
Osara=""
end
if Osara=="" and SWS=="" and js_ReaScript=="" and ReaImGui=="" and US_API=="" then return true end
local state=reaper.MB("This script needs additionally \n\n"..ReaImGui.."\n"..js_ReaScript.."\n"..US_API.."\n"..SWS.."\n"..Osara.."\n\ninstalled to work. Do you want to install them?", "Dependencies required", 4)
if state==7 then return false end
if SWS~="" then
reaper.MB("SWS can be downloaded from sws-extension.org/download/pre-release/", "SWS missing", 0)
end
if Osara~="" then
reaper.MB("Osara can be downloaded from https://osara.reaperaccessibility.com/", "Osara missing", 0)
end
if reaper.ReaPack_BrowsePackages==nil and (US_API~="" or ReaImGui~="" or js_ReaScript~="") then
reaper.MB("Some uninstalled dependencies need ReaPack to be installed. Can be downloaded from https://reapack.com/", "ReaPack missing", 0)
return false
else
if US_API=="Ultraschall API" then
reaper.ReaPack_AddSetRepository("Ultraschall API", "https://github.com/Ultraschall/ultraschall-lua-api-for-reaper/raw/master/ultraschall_api_index.xml", true, 2)
reaper.ReaPack_ProcessQueue(true)
end
if US_API~="" or ReaImGui~="" or js_ReaScript~="" then
reaper.ReaPack_BrowsePackages(js_ReaScript.." OR "..ReaImGui.." OR "..US_API)
end
end
end
return true
end