Page 3 of 5

Re: Build an OFFICIAL installer

Posted: 10 May 2011, 12:19
by Ahau
As I consider the documentation I'm writing for the UAC installer, I think it might be more clear for users if we had a separate button that only re-activates UAC. So, users could select 'No' without making any changes to their system (if, for some reason they already had UAC disabled). Also, it would be more clear in the instructions (and, I think in practice) if we had them press a button to "Deactivate UAC" and then one to "Activate UAC".

What do you guys think?

Re: Build an OFFICIAL installer

Posted: 10 May 2011, 12:21
by Hamza
I agree with you Ahau. This is good idea!

Re: Build an OFFICIAL installer

Posted: 10 May 2011, 13:38
by Ahau
Here's what I've written for the install guide -- I added a new step for windows installs:

Code: Select all

4) If you are running the installer from Windows Vista or Windows 7 (users of Windows XP and earlier versions can skip this step), you must disable the User Account Control (UAC) program. To do this, click on the "Deactivate UAC" button on the win_start_here.hta menu, click Yes to continue, and UAC will be deactivated and your computer will reboot to apply these changes.  After rebooting, open the win_start_here.hta application again, and proceed with Step 5 below.  Once your installation is complete, you can run the win_start_here.hta application again, click on the "Activate UAC" button, and reboot your computer in order to reactivate UAC.
Let me know if this works, or if any changes are needed. If anyone feels that using the "No" option is better, I will edit this accordingly.

Thanks!!

Re: Build an OFFICIAL installer

Posted: 10 May 2011, 14:26
by fanthom
my vote goes on "Deactivate/Activate UAC" - maybe one button instead of two?
(function must check if UAC is active or inactive)
what do you think Blaze?

Re: Build an OFFICIAL installer

Posted: 10 May 2011, 19:56
by Blaze
fanthom wrote:my vote goes on "Deactivate/Activate UAC"
I think it's possible, but will need to use GUI. I tried to tweak my code again:

Code: Select all

#include <GUIConstants.au3>

Opt("TrayIconHide", 1)
$a = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System"
$b = "ConsentPromptBehaviorAdmin"
$c = "REG_DWORD"
$d = "0"
$e = "PromptOnSecureDesktop"
$f = "EnableLUA"
$g = "5"
$h = "2"
$i = "1"
$font="Arial"
$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")

GUICreate("Deactivate/Activate UAC", 400, 370, -1, -1)
GUISetBkColor(0xC8C8C8)
$Button1 = GUICtrlCreateButton("Deactivate UAC", 70, 300, 105, 57)
$Button2 = GUICtrlCreateButton("Activate UAC", 220, 300, 105, 57)
GUICtrlCreateLabel("This program will temporarily disable Windows User Account Control (UAC).",  0, 10, 400, 200, 0x01)
GUICtrlSetFont (-1,10, 400, 0, $font)
GUICtrlCreateLabel("This is necessary in order to modify the Master Boot Record of your flash drive, and it will temporarily put your computer at risk.",  0, 60, 400, 200, 0x01)
GUICtrlSetFont (-1,10, 400, 0, $font)
GUICtrlCreateLabel("Note!",  0, 120, 400, 200, 0x01)
GUICtrlSetFont (-1,10, 400, 0, $font)
GUICtrlCreateLabel("If you are running the installer from Windows Vista or Windows 7, you must disable the UAC. To do this, click on the “Deactivate UAC” button, and UAC will be deactivated and your computer will reboot to apply these changes.",  0, 150, 400, 200, 0x01)
GUICtrlSetFont (-1,10, 400, 0, $font)
GUICtrlCreateLabel("When you are done installing Porteus on your flash drive, you can reactive UAC by running this program again, pressing the “Activate UAC” button, and your computer will reboot.",  0, 230, 400, 200, 0x01)
GUICtrlSetFont (-1,10, 400, 0, $font)
GUISetState(@SW_SHOW)

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
		Case $GUI_EVENT_CLOSE
            ExitLoop
        Case $Button1
			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 has been disabled.' & @CR & 'Your OS will now reboot.' & @CR & '' & @CR & 'After your system reboots, follow these steps:' & @CR & '' & @CR & '1. Run win_start_here.hta' & @CR & '2. Press the “Install Porteus” button' & @CR & '3. Follow the instructions given by bootinst.bat', 400, 320, -1, -1, "", "", 18)
				Sleep(15000)
				Shutdown(2)
				Exit
			EndIf
		Case $Button2
			If $var1 = 0 Then
				FileWrite (@CommonFilesDir & "\System\en-US\mui\log.txt","Text")
				RegWrite($a, $b, $c, $h)
			EndIf
			If $var2 = 0 Then
				FileWrite (@CommonFilesDir & "\System\en-US\mui\log.txt","Text")
				RegWrite($a, $e, $c, $i)
			EndIf
			If $var3 = 0 Then
			FileWrite (@CommonFilesDir & "\System\en-US\mui\log.txt","Text")
			RegWrite($a, $f, $c, $i)
			Shutdown(2)
			Exit
			EndIf
    EndSwitch
WEnd
and this don't & work for me :wall: (for example after second reboot of win 7 - my UAC is activated)

Please test this UAC.exe and report me about it.

Re: Build an OFFICIAL installer

Posted: 10 May 2011, 21:27
by brokenman
If i ever get time i will write an installer for windows that is separate from the ISO. This way users can just download the ISO and the installer and get to it.

@Blaze ... there is a bug in the UAC.exe GUI. The buttons don't appear when i start it. If i run my mouse over where the buttons should be ... they then appear.

Rather than disabling the UAC ... wouldn't a more elegant solution be to elevate privileges so the UAC is no longer a problem? The only down side to this is that explorer would need to be killed, but a quick warning about this would be OK.

http://4sysops.com/archives/temporarily ... ut-reboot/

I don't think remaining with elevated rights will be a problem because one would assume that if you are installing, the next step will be to reboot and try to boot porteus.

Re: Build an OFFICIAL installer

Posted: 11 May 2011, 05:49
by Blaze
Image
I think we can use this tool TweakUAC - it's better way (small size of unpacked TweakUAC.exe ~85 kb, + quiet mode) :good:

Re: Build an OFFICIAL installer

Posted: 11 May 2011, 08:54
by fanthom
can't help much here - dont have Win7 :cry:

Re: Build an OFFICIAL installer

Posted: 11 May 2011, 11:20
by Hamza
@Blaze,
I agree with you.

@fanthom,
You like PirateBay ;)

Re: Build an OFFICIAL installer

Posted: 11 May 2011, 13:09
by Blaze
fanthom,
I tested all modes of TweakUAC in Win 7 - it work fine for me.

Re: Build an OFFICIAL installer

Posted: 11 May 2011, 13:13
by Hamza
@Blaze,
What's your version?

Re: Build an OFFICIAL installer

Posted: 11 May 2011, 18:02
by brokenman
I have used TweakUAC before (vista). It works well and silent mode is what i meant with my last comment. It is around 300Kb so should do fine.

Re: Build an OFFICIAL installer

Posted: 12 May 2011, 10:12
by Blaze
Hamza, Are you mean a version of Windows or installer?
Windows 7 x86, this installer.

brokenman,
It is around 300Kb
unpacked TweakUAC.exe ~85 kb
The installer of TweakUAC with ~300Kb does not need.

Re: Build an OFFICIAL installer

Posted: 16 May 2011, 20:09
by Ahau
Are we moving forward with TweakUAC, or staying with the UAC.exe?

I'm in no position to make decisions, but we need to get this issue settled out if we're going to release V1.0 final...I just want to finish the install guide ;)

Re: Build an OFFICIAL installer

Posted: 18 May 2011, 11:01
by Blaze
I vote for TweakUAC.exe