Skip to content

Commit

Permalink
Merge pull request #7 from d2learn/win_adapt
Browse files Browse the repository at this point in the history
windows: update msvc/devcpp/rust/pmwrapper
  • Loading branch information
Sunrisepeak authored Dec 17, 2024
2 parents 5ea4c28 + c79401e commit 0abe2f7
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 8 deletions.
9 changes: 6 additions & 3 deletions pkgs/d/devcpp.lua
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ package = {
},
}

import("common")
import("xim.base.utils")
import("xim.base.runtime")

Expand All @@ -39,15 +40,17 @@ function install()
print("\t 1.先选English")
print("\t 2.使用默认选项安装")
print("\t 3.打开Dev-C++(这里可以重新选择IDE语言)")
os.exec(pkginfo.install_file)
common.xlings_exec(pkginfo.install_file)
utils.prompt("waiting install...", "")
return true
end

function uninstall()
local uninstall_exe = "C:\\Program Files (x86)\\Dev-Cpp\\uninstall.exe"
os.cd(path.directory(uninstall_exe))
while os.isfile(uninstall_exe) do
os.exec("uninstall.exe")
--os.exec(uninstall_exe) -- failed for windows
print("\n\t**请查看系统提示/please check system notification**\n")
common.xlings_exec("\"" .. uninstall_exe .. "\"")
utils.prompt("等待卸载/waiting uninstall...", "")
end
return true
Expand Down
8 changes: 5 additions & 3 deletions pkgs/m/msvc.lua
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,19 @@ package = {
}
}

import("common")
import("core.tool.toolchain")

-- https://learn.microsoft.com/en-us/visualstudio/install/workload-component-id-vs-build-tools?view=vs-2022
local msvc_component = "Microsoft.VisualStudio.Component.VC.Tools.x86.x64"

function installed()
return toolchain.load("msvc"):check() == "2022"
local msvc_path = [[C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC]]
return os.isdir(msvc_path) or toolchain.load("msvc"):check() == "2022"
end

function install()
os.exec(
common.xlings_exec(
"vs_BuildTools.exe" ..
-- " --installPath " .. vs_install_path ..
" --add " .. msvc_component ..
Expand All @@ -42,7 +44,7 @@ function install()
end

function uninstall()
os.exec(
common.xlings_exec(
"vs_BuildTools.exe" ..
" --remove " .. msvc_component ..
" --passive " ..
Expand Down
1 change: 1 addition & 0 deletions pkgs/r/rust.lua
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ import("xim.xinstall")
function installed()
os.exec("rustc --version")
os.exec("cargo --version")
os.exec("rustup --version")
return true
end

Expand Down
4 changes: 2 additions & 2 deletions pmwrapper.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

pmwrapper = {
["dotnet-9"] = {
windows = {"winget", "microsoft.dotnet.sdk.9"},
windows = {"winget", "Microsoft.DotNet.SDK.9"},
},
["gcc"] = {
ubuntu = {"apt", "gcc"},
Expand All @@ -20,7 +20,7 @@ pmwrapper = {
archlinux = {"pacman", "jdk8-openjdk"},
},
["python"] = {
windows = {"winget", "python.python.3.9"},
windows = {"winget", "Python.Python.3.13"},
ubuntu = {"apt", "python3"},
archlinux = {"pacman", "python"},
},
Expand Down

0 comments on commit 0abe2f7

Please sign in to comment.