Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/Jax-Core/JaxCore
Browse files Browse the repository at this point in the history
  • Loading branch information
EnhancedJax committed Aug 12, 2022
2 parents fae91f8 + bb04430 commit 8ed5209
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 23 deletions.
44 changes: 28 additions & 16 deletions CoreInstaller.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -236,14 +236,13 @@ public static extern bool IsWow64Process(

$bit = '32bit'
Get-Process -Id $rmprocess_id | Foreach {
$modules = $_.modules
foreach($module in $modules) {
$file = [System.IO.Path]::GetFileName($module.FileName).ToLower()
if($file -eq "wow64.dll") {
$bit = "32bit"
$is32Bit=[int]0
if ($_.Handle -ne $null) {
if ([Kernel32.NativeMethods]::IsWow64Process($_.Handle, [ref]$is32Bit)) {
$bit = "$(if ($is32Bit) {'32bit'} else {'64bit'})"
} else {
$bit = "64bit"
}
$bit = "32bit"
}
}
}

Expand All @@ -259,9 +258,8 @@ public static extern bool IsWow64Process(
Write-Done
# ---------------------------- Start installation ---------------------------- #
$root = "$root\Unpacked"
Write-Part "Starting installation process for package"
Write-Part "Getting archive info"
$skinspath = $root | Split-Path | Split-Path
Write-Done

debug "RainmeterPluginsBit: $bit"
debug "RainmeterPath: $settingspath"
Expand Down Expand Up @@ -349,6 +347,15 @@ public static extern bool IsWow64Process(
If ($skin_need_load) {
Wait-ForProcess 'Rainmeter'
Start-Sleep -Milliseconds 500
If (-not $rminstalled) {
Stop-Process -Name 'Rainmeter'
$Ini = Get-IniContent "$env:APPDATA\Rainmeter\Rainmeter.ini"
$Ini["Rainmeter"]["SkinPath"] = "$designatedskinspath"
Set-IniContent $Ini "$env:APPDATA\Rainmeter\Rainmeter.ini"
Start-Process "$($programpath)Rainmeter.exe"
Wait-ForProcess 'Rainmeter'
Start-Sleep -Milliseconds 500
}
& "$($programpath)Rainmeter.exe" [!ActivateConfig $skin_load_path]
}

Expand All @@ -358,9 +365,8 @@ public static extern bool IsWow64Process(
} else {
$skinFolder = $skinName
}
If (Test-Path -Path "$([Environment]::GetFolderPath("MyDocuments"))\Rainmeter\Skins\$skinFolder") {
If (Test-Path -Path "$skinspath\$skinFolder") {
Write-Emphasized "`n$skinName is installed successfully. "; Write-Part "Follow the instructions in the pop-up window. Press Enter to close this window"
Read-Host
Exit
}
}
Expand All @@ -373,9 +379,15 @@ if ($installSkin) {
$skinName = "JaxCore"
}

Write-Part "Checking if Rainmeter is installed"
$designatedskinspath = "$env:APPDATA\Rainmeter\Skins\"

Write-Part "COREINSTALLER REF: Stable v2"
Write-Done
Write-Part "Checking if Rainmeter is installed $designatedskinspath"

if (Check_Program_Installed("Rainmeter")) {
$rminstalled = Check_Program_Installed("Rainmeter")

if ($rminstalled) {
Write-Done
$Ini = Get-IniContent "$env:APPDATA\Rainmeter\Rainmeter.ini"
$root = "$($Ini["Rainmeter"]["SkinPath"])#CoreInstallerCache"
Expand Down Expand Up @@ -409,7 +421,7 @@ if (Check_Program_Installed("Rainmeter")) {
New-Item -Path "$env:APPDATA\Rainmeter" -Name "Rainmeter.ini" -ItemType "file" -Force -Value @"
[Rainmeter]
Logging=0
SkinPath=$([Environment]::GetFolderPath("MyDocuments"))\Rainmeter\Skins\
SkinPath=$designatedskinspath
HardwareAcceleration=1
[illustro\Clock]
Expand All @@ -422,6 +434,6 @@ Active=0
"@
Write-Done
# ---------------------------------- Install --------------------------------- #
$root = "$([Environment]::GetFolderPath("MyDocuments"))\Rainmeter\Skins\#CoreInstallerCache"
$root = "$designatedskinspath#CoreInstallerCache"
Install-Skin
}
}
28 changes: 21 additions & 7 deletions CoreInstallerBeta.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,15 @@ public static extern bool IsWow64Process(
If ($skin_need_load) {
Wait-ForProcess 'Rainmeter'
Start-Sleep -Milliseconds 500
If (-not $rminstalled) {
Stop-Process -Name 'Rainmeter'
$Ini = Get-IniContent "$env:APPDATA\Rainmeter\Rainmeter.ini"
$Ini["Rainmeter"]["SkinPath"] = "$designatedskinspath"
Set-IniContent $Ini "$env:APPDATA\Rainmeter\Rainmeter.ini"
Start-Process "$($programpath)Rainmeter.exe"
Wait-ForProcess 'Rainmeter'
Start-Sleep -Milliseconds 500
}
& "$($programpath)Rainmeter.exe" [!ActivateConfig $skin_load_path]
}

Expand All @@ -356,9 +365,8 @@ public static extern bool IsWow64Process(
} else {
$skinFolder = $skinName
}
If (Test-Path -Path "$([Environment]::GetFolderPath("MyDocuments"))\Rainmeter\Skins\$skinFolder") {
If (Test-Path -Path "$skinspath\$skinFolder") {
Write-Emphasized "`n$skinName is installed successfully. "; Write-Part "Follow the instructions in the pop-up window. Press Enter to close this window"
Read-Host
Exit
}
}
Expand All @@ -371,9 +379,15 @@ if ($installSkin) {
$skinName = "JaxCore"
}

Write-Part "Checking if Rainmeter is installed"
$designatedskinspath = "$env:APPDATA\Rainmeter\Skins\"

Write-Part "COREINSTALLER REF: 3"
Write-Done
Write-Part "Checking if Rainmeter is installed $designatedskinspath"

if (Check_Program_Installed("Rainmeter")) {
$rminstalled = Check_Program_Installed("Rainmeter")

if ($rminstalled) {
Write-Done
$Ini = Get-IniContent "$env:APPDATA\Rainmeter\Rainmeter.ini"
$root = "$($Ini["Rainmeter"]["SkinPath"])#CoreInstallerCache"
Expand Down Expand Up @@ -407,7 +421,7 @@ if (Check_Program_Installed("Rainmeter")) {
New-Item -Path "$env:APPDATA\Rainmeter" -Name "Rainmeter.ini" -ItemType "file" -Force -Value @"
[Rainmeter]
Logging=0
SkinPath=$([Environment]::GetFolderPath("MyDocuments"))\Rainmeter\Skins\
SkinPath=$designatedskinspath
HardwareAcceleration=1
[illustro\Clock]
Expand All @@ -420,6 +434,6 @@ Active=0
"@
Write-Done
# ---------------------------------- Install --------------------------------- #
$root = "$([Environment]::GetFolderPath("MyDocuments"))\Rainmeter\Skins\#CoreInstallerCache"
$root = "$designatedskinspath#CoreInstallerCache"
Install-Skin
}
}

0 comments on commit 8ed5209

Please sign in to comment.