# 모두뷰어 설치 (https://sokdak.co.kr/i/moduviewer) — 속닥 · Bigjoy Inc. # 받은 묶음의 SHA-256 지문이 아래 값과 같을 때만, 관리자 권한 없이 이 사용자에게 설치합니다. $ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue' [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 $name = '모두뷰어'; $id = 'moduviewer'; $sha = '054b8fb4c632f97a8c6712da73d60a6ca632742d687b340a54438d43b463f1b5' $auto = "$env:SOKDAK_MODE" -eq 'auto'; $base = 'https://sokdak.co.kr'; if ($env:SOKDAK_BASE) { $base = $env:SOKDAK_BASE }; $why = '' try { $Host.UI.RawUI.WindowTitle = $name + ' 설치' } catch { } $tmp = Join-Path $env:TEMP ('sokdak-' + $id + '-' + [guid]::NewGuid().ToString('N').Substring(0, 6)); $ok = $false try { Write-Host ''; Write-Host (' ' + $name + ' 설치 (무료 · 관리자 권한 필요 없음)') -ForegroundColor Cyan; Write-Host '' New-Item -ItemType Directory -Force $tmp | Out-Null Write-Host (' 1/3 1.9.6 (2026.12.06) 받는 중… (44.2 MB)') $zip = Join-Path $tmp ($id + '.zip') Invoke-WebRequest ($base + '/files/' + $id + '.zip?v=' + $sha.Substring(0, 8) + '') -OutFile $zip -UseBasicParsing Write-Host ' 2/3 받은 파일 확인 중…' if ((Get-FileHash $zip -Algorithm SHA256).Hash.ToLower() -ne $sha) { throw '받은 파일의 지문이 맞지 않습니다 (새 판을 올리는 중일 수 있어요). 1분 뒤 다시 해 주세요.' } Expand-Archive $zip (Join-Path $tmp 'x') -Force $s = Get-ChildItem (Join-Path $tmp 'x') -Recurse -Depth 1 -Include 'setup.ps1', 'install.ps1' | Sort-Object { $_.Name -ne 'setup.ps1' } | Select-Object -First 1 if (-not $s) { throw '묶음 안에 설치 스크립트가 없습니다.' } Write-Host ' 3/3 설치 중…' $a = @('-NoProfile', '-ExecutionPolicy', 'Bypass', '-File', $s.FullName); if ($auto) { $a += '-Quiet'; $a += '-Launch' } if ($auto -and $env:SOKDAK_TARGET) { $a += '-Target'; $a += $env:SOKDAK_TARGET; $a += '-NoShortcut'; if ($s.Name -eq 'setup.ps1') { $a += '-NoRegister'; $a += '-NoMenu' } } # 시험용: 다른 폴더에만 & (Join-Path $env:WINDIR 'System32\WindowsPowerShell\v1.0\powershell.exe') @a if ($LASTEXITCODE -eq 3) { throw '고치는 중인 파일이 있습니다. 저장하거나 닫은 뒤 다시 업데이트해 주세요.' } if ($LASTEXITCODE) { throw ('설치 중 문제가 생겼습니다 (코드 ' + $LASTEXITCODE + ').') } $ok = $true; Write-Host ''; Write-Host (' 설치 끝 — 바탕화면·시작 메뉴에 「' + $name + '」 아이콘이 생겼어요.') -ForegroundColor Green } catch { $why = $_.Exception.Message Write-Host ''; Write-Host (' 설치하지 못했습니다: ' + $why) -ForegroundColor Red Write-Host ' 인터넷 연결을 확인하고 다시 해 보세요. 계속 안 되면 thegamsakr@gmail.com 으로 이 화면을 보내 주세요.' -ForegroundColor Yellow } finally { Remove-Item $tmp -Recurse -Force -ErrorAction SilentlyContinue } if ($auto) { if (-not $ok) { Add-Type -AssemblyName System.Windows.Forms [System.Windows.Forms.MessageBox]::Show("업데이트하지 못했습니다.`n`n" + $why + "`n`n쓰던 버전은 그대로 쓸 수 있습니다.", $name, 'OK', 'Information') | Out-Null # 설치 도중 꺼졌으면 쓰던 것을 다시 켬 $run = "$env:SOKDAK_RUN" if ($run -and (Test-Path -LiteralPath $run) -and -not (Get-CimInstance Win32_Process -Filter "Name='powershell.exe'" | Where-Object { $_.CommandLine -like ('*' + $run + '*') })) { Start-Process (Join-Path $env:WINDIR 'System32\conhost.exe') -ArgumentList ('--headless "' + (Join-Path $env:WINDIR 'System32\WindowsPowerShell\v1.0\powershell.exe') + '" -NoProfile -WindowStyle Hidden -STA -ExecutionPolicy Bypass -File "' + $run + '"') } } } elseif (-not $ok) { Write-Host ''; Read-Host ' 엔터를 누르면 닫힙니다' | Out-Null } else { Start-Sleep -Seconds 3 }