Skip to content

Commit

Permalink
fixes #9 - NSIS fix for powershell
Browse files Browse the repository at this point in the history
  • Loading branch information
mikeslattery committed Feb 18, 2020
1 parent 872e2b0 commit 67a476f
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
2 changes: 2 additions & 0 deletions files/grub.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ menuentry "Tunic Automatic Linux Installer" {
ls
ls ($root)
echo "ISO: ${root} ${iso_path}"
echo ''

echo 'Loading Linux kernel...'
linux (loop)/casper/vmlinuz file=/isodevice${tunic_dir}/preseed.cfg automatic-ubiquity boot=casper iso-scan/filename=${iso_path} nomodeset toram noprompt --
Expand All @@ -41,6 +42,7 @@ menuentry "Try out Linux without install" {
ls
ls ($root)
echo "ISO: ${root} ${iso_path}"
echo ''

echo 'Loading Linux kernel...'
linux (loop)/casper/vmlinuz boot=casper iso-scan/filename=${iso_path} nomodeset toram noprompt --
Expand Down
8 changes: 7 additions & 1 deletion tunic.nsi
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,16 @@ SilentInstall silent
Unicode true
Icon "files\tunic-logo.ico"

!include x64.nsh

Section "Tunic Linux Installer"
SetOutPath "$TEMP\Tunic"
file tunic.ps1
file /r files
ExecWait 'powershell.exe -executionpolicy bypass -nologo -inputformat none -noninteractive -WindowStyle Hidden -file tunic.ps1 hidden'
${If} ${RunningX64}
ExecWait '$WINDIR\sysnative\windowspowershell\v1.0\powershell.exe -executionpolicy bypass -nologo -inputformat none -noninteractive -WindowStyle Hidden -file tunic.ps1'
${Else}
ExecWait 'powershell.exe -executionpolicy bypass -nologo -inputformat none -noninteractive -WindowStyle Hidden -file tunic.ps1'
${EndIf}
SectionEnd

8 changes: 3 additions & 5 deletions tunic.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ function downloadIso() {
if ( -not (Test-Path "$iso_path") ) {
$ciso = "Z:\Downloads\$iso_file"
if ( Test-Path "$ciso" ) {
echo 'Cached.'
write-host 'Cached.'
copy "$ciso" "$iso_path"
} else {
try {
Expand Down Expand Up @@ -1149,17 +1149,15 @@ function hideConsole() {

$consoleWin = [Console.Window]::GetConsoleWindow()

write-host "c = $consoleWin"

# https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-showwindow
[Console.Window]::ShowWindow($consoleWin, 6)
[void][Console.Window]::ShowWindow($consoleWin, 6)
}

function uninstall() {
if( !([Security.Principal.WindowsPrincipal] `
[Security.Principal.WindowsIdentity]::GetCurrent() `
).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator) ) {
echo 'Must be an Administrator'
write-host 'Must be an Administrator'
exit 1
}
if( test-path("${global:tunic_dir}\bcd.id") ) {
Expand Down

0 comments on commit 67a476f

Please sign in to comment.