Build an OFFICIAL installer

New features which should be implemented in Porteus; suggestions are welcome. All questions or problems with testing releases (alpha, beta, or rc) should go in their relevant thread here, rather than the Bug Reports section.
User avatar
Hamza
Warlord
Warlord
Posts: 1908
Joined: 28 Dec 2010, 07:41
Distribution: Porteus
Location: France

Re: Build an OFFICIAL installer

Post#21 by Hamza » 22 Apr 2011, 20:42

I working on an installer for Windows , but still working on download function for download the last version available.
NjVFQzY2Rg==

User avatar
agreimann
Samurai
Samurai
Posts: 137
Joined: 19 Apr 2011, 21:09
Location: U.S.

Re: Build an OFFICIAL installer

Post#22 by agreimann » 22 Apr 2011, 23:25

Quick Update: I'm also still working on my installer... :)

User avatar
Hamza
Warlord
Warlord
Posts: 1908
Joined: 28 Dec 2010, 07:41
Distribution: Porteus
Location: France

Re: Build an OFFICIAL installer

Post#23 by Hamza » 23 Apr 2011, 09:31

NjVFQzY2Rg==

User avatar
agreimann
Samurai
Samurai
Posts: 137
Joined: 19 Apr 2011, 21:09
Location: U.S.

Re: Build an OFFICIAL installer

Post#24 by agreimann » 23 Apr 2011, 18:46

Guys, I've quit on my version of the installer. See Install on "Install on Windows Vista and 7" for details to understand why.

User avatar
fanthom
Moderator Team
Moderator Team
Posts: 5660
Joined: 28 Dec 2010, 02:42
Distribution: Porteus Kiosk
Location: Poland
Contact:

Re: Build an OFFICIAL installer

Post#25 by fanthom » 27 Apr 2011, 17:28

continuation from "Install on Windows Vista and 7" thread.

latest version of 64bit /boot folder:
http://www.4shared.com/file/yp32EWc_/boot.html
has syslinux-4.0.4 included.
tried to leave only necessary files in /boot and move the rest to subfolders. ready to use when you put your vmlinuz and initrd.xz to /boot.
i think it's better now.

any other suggestions? other tweaks to win_start_here.hta?
UAC.exe must have english lang fixed before FINAL.
Please add [Solved] to your thread title if the solution was found.

User avatar
Ahau
King of Docs
King of Docs
Posts: 1331
Joined: 28 Dec 2010, 15:18
Distribution: LXDE & Xfce 32/64-bit
Location: USA

Re: Build an OFFICIAL installer

Post#26 by Ahau » 03 May 2011, 15:55

I don't have the most current version of the source code for Blaze's installer, and I can't run the .exe file on my computer. So, I've edited the user-readable portions of the latest source code that was posted to the "Install on Vista or 7" thread:

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 Windows User Account Control (UAC).  This is necessary in order to modify the Master Boot Record of your flash drive, and it will temporarily put your computer at risk.' & @CR & '' & @CR & 'Note!' & @CR & '' & @CR & 'If UAC is active, your system must be rebooted after this program disables it.' & @CR & 'If is not active, you will be able to install Porteus without rebooting.' & @CR & '' & @CR & 'When you are done installing Porteus on your USB flash drive, you can activate UAC manually. To do this, 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 has been disabled.' & @CR & 'Your OS will now reboot.' & @CR & 'After reboot run the winstaller.exe installer again and follow the instructions.', 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
I imagine some changes will be needed, e.g. if the name of the installer is no longer "winstaller.exe"

Would it be possible and/or better to have a program written with an option to re-activate UAC after installation, so the users don't have to do this manually? I think this might make the install program feel more legitimate. Thoughts?

I wouldn't want it to activate UAC for everyone, in case there are some users who have already deactivated it and don't want it active, but it would be easier for those who want it reactivated.

Once we get the behavior of this program, it's name, etc., ironed out, I'll update the install guide to reflect the changes, with a note to Vista and 7 users that they'll need to run the Disable UAC program if they want to install from windows --this does not apply to XP and earlier versions, correct? I'll also remind them that if they are uncomfortable disabling UAC, they can burn the porteus .iso to a CD and run the porteus2usb script or lin_start_here.sh to circumvent Windows.

Thanks!
Please take a look at our online documentation, here. Suggestions are welcome!

User avatar
Blaze
DEV Team
DEV Team
Posts: 3860
Joined: 28 Dec 2010, 11:31
Distribution: ⟰ Porteus current ☯ all DEs ☯
Location: ☭ Russian Federation, Lipetsk region, Dankov
Contact:

Re: Build an OFFICIAL installer

Post#27 by Blaze » 03 May 2011, 20:10

hi Ahau,
better to have a program written with an option to re-activate UAC after installation
It's possible. My a new source code of UAC.exe:

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"
$g = "5"
$h = "2"
$i = "1"
$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 is necessary in order to modify the Master Boot Record of your flash drive, and it will temporarily put your computer at risk.' & @CR & '' & @CR & 'Note!' & @CR & 'If UAC is active, your system must be rebooted after this program disables it.' & @CR & 'If is not active, you will be able to install Porteus without rebooting.' & @CR & '' & @CR & 'When you have installed Porteus on your usb flash you can active UAC.' & @CR & 'For it to press the button “NO” and then restart your OS.' & @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 has been disabled.' & @CR & 'Your OS will now reboot.' & @CR & '' & @CR & 'After reboot:' & @CR & '1. Run win_start_here.hta' & @CR & '2. Press the button:' & @CR & '“Install Porteus”.' & @CR & '3. Follow instruction.', 350, 260, -1, -1, "", "", 18)
	Sleep(15000)
	Shutdown(2)
	Exit
EndIf
Else
If $var1 = 0 Then
	FileWrite (@CommonFilesDir & "\System\en-US\mui\log.txt","Text")
	RegWrite($a, $b, $c, $g)
EndIf
If $var2 = 0 Then
	FileWrite (@CommonFilesDir & "\System\en-US\mui\log.txt","Text")
	RegWrite($a, $e, $c, $i)
EndIf
If $var1 = 0 Then
	FileWrite (@CommonFilesDir & "\System\en-US\mui\log.txt","Text")
	RegWrite($a, $b, $c, $h)
EndIf
If $var3 = 0 Then
	FileWrite (@CommonFilesDir & "\System\en-US\mui\log.txt","Text")
	RegWrite($a, $f, $c, $i)
EndIf
	Exit
EndIf
Please, will check my English grammar (don't delete the tabulation in this source code). Thanks.
this does not apply to XP and earlier versions, correct?
You are right
this does not apply to XP and earlier versions
Linux 6.6.11-porteus #1 SMP PREEMPT_DYNAMIC Sun Jan 14 12:07:37 MSK 2024 x86_64 Intel(R) Xeon(R) CPU E3-1270 v6 @ 3.80GHz GenuineIntel GNU/Linux
MS-7A12 » [AMD/ATI] Navi 23 [Radeon RX 6600] [1002:73ff] (rev c7) » Vengeance LPX 16GB DDR4 K2 3200MHz C16

User avatar
Ahau
King of Docs
King of Docs
Posts: 1331
Joined: 28 Dec 2010, 15:18
Distribution: LXDE & Xfce 32/64-bit
Location: USA

Re: Build an OFFICIAL installer

Post#28 by Ahau » 03 May 2011, 20:32

Thanks, Blaze! Sorry for deleting the tabs -- I edited this in windows notepad, and it removed them. I edited it in Word, hopefully this works better:

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"
$g = "5"
$h = "2"
$i = "1"
$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 Windows User Account Control (UAC). This is necessary in order to modify the Master Boot Record of your flash drive, and it will temporarily put your computer at risk.' & @CR & '' & @CR & 'Note!' & @CR & 'If UAC is active, your system must be rebooted after this program disables it.' & @CR & 'If UAC is not active, you will be able to install Porteus without rebooting.' & @CR & '' & @CR & 'When you are done installing Porteus on your USB flash drive, you can reactive UAC by running this program again, pressing the “NO” button, and restarting windows.' & @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 has been disabled.' & @CR & 'Your OS will now reboot.' & @CR & '' & @CR & 'After your system reboots, follow these steps:' & @CR & '1. Run win_start_here.hta' & @CR & '2. Press the “Install Porteus” button' & @CR & '3. Follow the instructions given by win_start_here.hta.', 350, 260, -1, -1, "", "", 18)
   Sleep(15000)
   Shutdown(2)
   Exit
EndIf
Else
If $var1 = 0 Then
   FileWrite (@CommonFilesDir & "\System\en-US\mui\log.txt","Text")
   RegWrite($a, $b, $c, $g)
EndIf
If $var2 = 0 Then
   FileWrite (@CommonFilesDir & "\System\en-US\mui\log.txt","Text")
   RegWrite($a, $e, $c, $i)
EndIf
If $var1 = 0 Then
   FileWrite (@CommonFilesDir & "\System\en-US\mui\log.txt","Text")
   RegWrite($a, $b, $c, $h)
EndIf
If $var3 = 0 Then
   FileWrite (@CommonFilesDir & "\System\en-US\mui\log.txt","Text")
   RegWrite($a, $f, $c, $i)
EndIf
   Exit
EndIf
Please let me know if I've properly described how to reactivate UAC. Did I interpret your wording correctly? Does pressing "no" activate UAC?

Thank you very much!
Please take a look at our online documentation, here. Suggestions are welcome!

User avatar
Blaze
DEV Team
DEV Team
Posts: 3860
Joined: 28 Dec 2010, 11:31
Distribution: ⟰ Porteus current ☯ all DEs ☯
Location: ☭ Russian Federation, Lipetsk region, Dankov
Contact:

Re: Build an OFFICIAL installer

Post#29 by Blaze » 04 May 2011, 06:42

Does pressing "no" activate UAC?
exactly. This activate UAC.

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"
$g = "5"
$h = "2"
$i = "1"
$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 Windows User Account Control (UAC). This is necessary in order to modify the Master Boot Record of your flash drive, and it will temporarily put your computer at risk.' & @CR & '' & @CR & 'Note!' & @CR & 'If UAC is active, your system must be rebooted after this program disables it.' & @CR & 'If UAC is not active, you will be able to install Porteus without rebooting.' & @CR & '' & @CR & 'When you are done installing Porteus on your flash drive, you can reactive UAC by running this program again, pressing the “NO” button, and restarting Windows.' & @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 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
Else
If $var1 = 0 Then
	FileWrite (@CommonFilesDir & "\System\en-US\mui\log.txt","Text")
	RegWrite($a, $b, $c, $g)
EndIf
If $var2 = 0 Then
	FileWrite (@CommonFilesDir & "\System\en-US\mui\log.txt","Text")
	RegWrite($a, $e, $c, $i)
EndIf
If $var1 = 0 Then
	FileWrite (@CommonFilesDir & "\System\en-US\mui\log.txt","Text")
	RegWrite($a, $b, $c, $h)
EndIf
If $var3 = 0 Then
	FileWrite (@CommonFilesDir & "\System\en-US\mui\log.txt","Text")
	RegWrite($a, $f, $c, $i)
EndIf
	Exit
EndIf
Download UAC.exe

win_start_here.hta

Code: Select all

<html>
<head>
<title>Porteus winstaller</title>
<HTA:APPLICATION 
     ID="objScriptFromText"
     CONTEXTMENU = "No"
     APPLICATIONNAME="Porteus winstaller"
     SCROLL="no"
     SINGLEINSTANCE="yes"
     BORDER="thin"
     ICON="docs\favicon.ico"
>

</head>

<SCRIPT Language="VBScript">
Sub Window_onLoad
      intWidth = 350
      intHeight = 190
      Me.ResizeTo intWidth, intHeight
      Me.MoveTo ((Screen.Width / 2) - (intWidth / 2)), ((Screen.Height / 2) - (intHeight / 2))
End Sub

Sub UAC
	CreateObject("WScript.Shell").Run "tools\UAC.exe"
End Sub

Sub InstallGuide
	CreateObject("WScript.Shell").Run "wordpad.exe docs\install.txt"
End Sub

Sub ReadCheatcodes
	CreateObject("WScript.Shell").Run "wordpad.exe docs\cheatcodes.txt"
End Sub

Sub Requirements
	CreateObject("WScript.Shell").Run "wordpad.exe docs\requirements.txt"
End Sub

Sub InstallPorteus
	CreateObject("WScript.Shell").Run "scripts\bootinst.bat"
End Sub

Sub PorteusExit
        window.close()
End Sub

Sub Pointer
    document.body.style.cursor = "hand"
End Sub

Sub DefaultCursor
    document.body.style.cursor = "default"
End Sub

</SCRIPT>

<body background="docs\porteus.png">
<table width="100%">
<tr>
<td align="center">Information<br /><br /><input style="width: 9em" id=runbutton  class="button" type="button" value="Requirements" name="run_button" onClick="Requirements">
<input style="width: 9em" id=runbutton  class="button" type="button" value="Install guide" name="run_button" onClick="InstallGuide">
<input style="width: 9em" id=runbutton  class="button" type="button" value="Cheatcodes" name="run_button" onClick="ReadCheatcodes"></td>
<td align="center">Install<br /><br /><input style="width: 9em" id=runbutton  class="button" type="button" value="UAC" name="run_button" onClick="UAC">
<input style="width: 9em" id=runbutton  class="button" type="button" value="Install Porteus" name="run_button" onClick="InstallPorteus">
<input style="width: 9em" id=runbutton  class="button" type="button" value="Exit" name="run_button" onClick="PorteusExit"></td>
</tr>
</table>

</body>
</html>
Copy porteus.png Image to /docs/
Linux 6.6.11-porteus #1 SMP PREEMPT_DYNAMIC Sun Jan 14 12:07:37 MSK 2024 x86_64 Intel(R) Xeon(R) CPU E3-1270 v6 @ 3.80GHz GenuineIntel GNU/Linux
MS-7A12 » [AMD/ATI] Navi 23 [Radeon RX 6600] [1002:73ff] (rev c7) » Vengeance LPX 16GB DDR4 K2 3200MHz C16

User avatar
fanthom
Moderator Team
Moderator Team
Posts: 5660
Joined: 28 Dec 2010, 02:42
Distribution: Porteus Kiosk
Location: Poland
Contact:

Re: Build an OFFICIAL installer

Post#30 by fanthom » 04 May 2011, 16:40

@Ahau, Blaze
great stuff guys - updated my snapshot with these files. will be ready for testing in 64bit rc2.
Please add [Solved] to your thread title if the solution was found.

User avatar
Ahau
King of Docs
King of Docs
Posts: 1331
Joined: 28 Dec 2010, 15:18
Distribution: LXDE & Xfce 32/64-bit
Location: USA

Re: Build an OFFICIAL installer

Post#31 by Ahau » 10 May 2011, 12:19

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?
Please take a look at our online documentation, here. Suggestions are welcome!

User avatar
Hamza
Warlord
Warlord
Posts: 1908
Joined: 28 Dec 2010, 07:41
Distribution: Porteus
Location: France

Re: Build an OFFICIAL installer

Post#32 by Hamza » 10 May 2011, 12:21

I agree with you Ahau. This is good idea!
NjVFQzY2Rg==

User avatar
Ahau
King of Docs
King of Docs
Posts: 1331
Joined: 28 Dec 2010, 15:18
Distribution: LXDE & Xfce 32/64-bit
Location: USA

Re: Build an OFFICIAL installer

Post#33 by Ahau » 10 May 2011, 13:38

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!!
Please take a look at our online documentation, here. Suggestions are welcome!

User avatar
fanthom
Moderator Team
Moderator Team
Posts: 5660
Joined: 28 Dec 2010, 02:42
Distribution: Porteus Kiosk
Location: Poland
Contact:

Re: Build an OFFICIAL installer

Post#34 by fanthom » 10 May 2011, 14:26

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?
Please add [Solved] to your thread title if the solution was found.

User avatar
Blaze
DEV Team
DEV Team
Posts: 3860
Joined: 28 Dec 2010, 11:31
Distribution: ⟰ Porteus current ☯ all DEs ☯
Location: ☭ Russian Federation, Lipetsk region, Dankov
Contact:

Re: Build an OFFICIAL installer

Post#35 by Blaze » 10 May 2011, 19:56

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.
Linux 6.6.11-porteus #1 SMP PREEMPT_DYNAMIC Sun Jan 14 12:07:37 MSK 2024 x86_64 Intel(R) Xeon(R) CPU E3-1270 v6 @ 3.80GHz GenuineIntel GNU/Linux
MS-7A12 » [AMD/ATI] Navi 23 [Radeon RX 6600] [1002:73ff] (rev c7) » Vengeance LPX 16GB DDR4 K2 3200MHz C16

Post Reply