Page 4 of 4

Re: Install on Vista or 7

Posted: 25 Apr 2011, 21:12
by Hamza
I will write a shell installer (similar to Migration Tool)

Re: Install on Vista or 7

Posted: 26 Apr 2011, 10:41
by Blaze
fanthom, ok.
Try my a new version winstaller.rar (+ I tweaked the win_start_here.hta)

Source code:

Code: Select all

#NoTrayIcon
#RequireAdmin
Opt("TrayIconHide", 1)
$a = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System"
$b = "ConsentPromptBehaviorAdmin"
$c = "REG_DWORD"
$d = "0"
$e = "PromptOnSecureDesktop"
$f = "EnableLUA"
$aDrives = DriveGetDrive("All")
$var1 = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System", "ConsentPromptBehaviorAdmin")
$var2 = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System", "PromptOnSecureDesktop")
$var3 = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System", "EnableLUA")
$response = MsgBox(4, "Warning", 'This program will temporarily disable UAC. This may put your computer at risk.' & @CR & 'It necessary for install Porteus to a flah drive.' & @CR & '' & @CR & 'Note!' & @CR & '' & @CR & 'If UAC is active, your system will be rebooted for disable it.' & @CR & 'If is not, to you it will be accessible Porteus Winstaller.' & @CR & '' & @CR & 'When you have installed Porteus on your usb flash you can active UAC manually. You will need to type “uac” in the Start menu, click "Change User Account Control Settings" and restart.' & @CR & '' & @CR & 'Are you sure you want to continue?')
If $response = 6 then
If $var1 = 5 Then
	FileWrite (@CommonFilesDir & "\System\en-US\mui\log.txt","Text")
	RegWrite($a, $b, $c, $d)
EndIf
If $var2 = 1 Then
	FileWrite (@CommonFilesDir & "\System\en-US\mui\log.txt","Text")
	RegWrite($a, $e, $c, $d)
EndIf
If $var1 = 2 Then
	FileWrite (@CommonFilesDir & "\System\en-US\mui\log.txt","Text")
	RegWrite($a, $b, $c, $d)
EndIf
If $var3 = 1 Then
	FileWrite (@CommonFilesDir & "\System\en-US\mui\log.txt","Text")
	RegWrite($a, $f, $c, $d)
	SplashTextOn("Warning", 'UAC was disabled.' & @CR & 'Your OS will reboot.' & @CR & 'After reboot run the winstaller.exe installer again and follow instruction.', 310, 250, -1, -1, "", "", 24)
	Sleep(15000)
	Shutdown(2)
	Exit
EndIf
For $i = 1 To $aDrives[0]
	If DriveStatus($aDrives[$i]) <> "READY" Then ContinueLoop
	If FileExists($aDrives[$i] & "\boot\win_start_here.hta") Then
		FileChangeDir($aDrives[$i] & "\boot\")
		ShellExecute("win_start_here.hta")
		ExitLoop
    EndIf
Next
Else
	Exit
EndIf
Cheers

Re: Install on Vista or 7

Posted: 26 Apr 2011, 12:35
by Hamza
I see the source of your installer...

And , You have added an autorun function for start win_start.hta from /boot folder.

That's great , you have added a function for looks if win_start_here.hta exist before to run it.

You doing a great works!

Re: Install on Vista or 7

Posted: 27 Apr 2011, 10:46
by fanthom
@Blaze
yep - good job :)
anyway i would do it differently (just a suggestion)
1) user would start "win_start_here.hta" as normal which could check if user is running Vista/Win7, if yes then win_start_here.hta could call 'winstaller' placed in /boot/tools to disable UAC. is it possible?

Re: Install on Vista or 7

Posted: 27 Apr 2011, 14:18
by Blaze
fanthom, I think it's possible, but need to tweak win_start_here.hta
I try to tweak win_start_here.hta...
I have problem with run "boot\tools\winstaller.exe" on Visual Basic (look at blue line)
Sub DisableUAC
CreateObject("WScript.Shell").Run "boot\tools\winstaller.exe"
End Sub
I'm very bad in Visual Basic. I need help. Download and test it.

Re: Install on Vista or 7

Posted: 27 Apr 2011, 16:36
by fanthom
@Blaze
thats because path is wrong:
"CreateObject("WScript.Shell").Run "boot\tools\winstaller.exe""
should be:
"CreateObject("WScript.Shell").Run "tools\winstaller.exe""

i have re based whole /boot folder and tweaked all scripts. /boot looks more tidy now. need to ask Ahau to fix docs. give me a while and i will publish new version of /boot folder with syslinux-4.04.

it's getting really off topic here, let's move back to Development thread:
http://forum.porteus.org/viewtopic.php? ... 9&start=20

Re: Install on Vista or 7

Posted: 27 Apr 2011, 20:36
by Blaze
fanthom, you are right :)
I some tweaked my installer for this. Try this variant.
UAC.exe must have english lang fixed before FINAL.
Please report about my mistakes (sorry about my english :oops:) and i fix it.
Cheers ;)