Skip to content

Commit c6ec45c

Browse files
committed
Added uninstall GUI
1 parent 23da039 commit c6ec45c

File tree

4 files changed

+182
-8
lines changed

4 files changed

+182
-8
lines changed

English.ini

528 Bytes
Binary file not shown.

UniExtract.au3

Lines changed: 55 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
#include <GuiComboBoxEx.au3>
4545
#include <GUIEdit.au3>
4646
#include <GuiListBox.au3>
47+
#include <GuiMenu.au3>
4748
#include <INet.au3>
4849
#include <InetConstants.au3>
4950
#include <Math.au3>
@@ -172,7 +173,7 @@ Global $file, $filename, $filenamefull, $filedir, $fileext, $sFileSize, $initout
172173
Global $hMutex, $hProgress, $hTridDll = 0
173174
Global $prompt, $prefs, $sUpdateURL = $sUrlUpdateStable, $eCustomPromptSetting = $PROMPT_ASK
174175
Global $Type, $silent, $iUnicodeMode = $UNICODE_NONE, $reg64 = "", $iOsArch = 32
175-
Global $logdir, $archdir, $userDefDir, $batchQueue, $fileScanLogFile, $sPasswordFile, $aDefDirs[0]
176+
Global $logdir, $archdir, $settingsdir, $userDefDir, $batchQueue, $fileScanLogFile, $sPasswordFile, $aDefDirs[0]
176177
Global $sFullLog = "", $success = $RESULT_UNKNOWN, $sArcTypeOverride = 0, $sMethodSelectOverride = 0
177178
Global $innofailed, $arjfailed, $7zfailed, $zipfailed, $iefailed, $isofailed, $tridfailed, $gamefailed, $observerfailed
178179
Global $unpackfailed, $exefailed, $ttarchfailed
@@ -616,12 +617,12 @@ Func ParseCommandLine()
616617
$prompt = True
617618
GUI_Plugins()
618619

619-
ElseIf $cmdline[1] = "/remove" Or $cmdline[1] = "/uninstall" Then
620-
_IsWin7OrNewer()
621-
GUI_ContextMenu_remove()
622-
GUI_ContextMenu_fileassoc(0)
623-
SendStats("uninstall")
624-
terminate($STATUS_SILENT)
620+
ElseIf $cmdline[1] = "/uninstall" Then
621+
If $silentmode Then
622+
Uninstall(True, _ArraySearch($cmdline, "/removeuserdata"))
623+
Else
624+
GUI_Uninstall()
625+
EndIf
625626

626627
ElseIf $cmdline[1] = "/batchclear" Then
627628
GUI_Batch_Clear()
@@ -694,7 +695,7 @@ Func ReadPrefs()
694695
If IsAdmin() Then Cout("Warning: running as admin")
695696

696697
; Select ini file
697-
Local $settingsdir = @AppDataDir & "\Bioruebe\UniExtract"
698+
Global $settingsdir = @AppDataDir & "\Bioruebe\UniExtract"
698699
Local Const $globalIni = @ScriptDir & "\UniExtract.ini"
699700
Local Const $userIni = $settingsdir & "\UniExtract.ini"
700701

@@ -4317,6 +4318,7 @@ Func _DeleteTrayMessageBox()
43174318
$TBgui = 0
43184319
EndFunc
43194320

4321+
; Display a message and wait for the given time
43204322
Func _Sleep($iDuration, $sMessage = "PROCESSING")
43214323
_CreateTrayMessageBox(t($sMessage))
43224324

@@ -5737,6 +5739,19 @@ Func RepairProgramFiles($sMsg)
57375739
Return True
57385740
EndFunc
57395741

5742+
; Remove explorer integration and optionally remove user data
5743+
Func Uninstall($bRemoveLogs = True, $bRemoveUserData = False)
5744+
SendStats("uninstall")
5745+
5746+
GUI_ContextMenu_remove()
5747+
GUI_ContextMenu_fileassoc(0)
5748+
5749+
If $bRemoveLogs Then GUI_DeleteLogs()
5750+
If $bRemoveUserData Then DirRemove($settingsdir, 1)
5751+
5752+
terminate($STATUS_SILENT)
5753+
EndFunc
5754+
57405755
; ------------------------ Begin GUI Control Functions ------------------------
57415756

57425757
; Build and display GUI if necessary
@@ -7350,6 +7365,38 @@ Func GUI_FirstStart_Exit()
73507365
Cout("First start configuration finished")
73517366
EndFunc
73527367

7368+
; Ask user whether to keep settings or not and uninstall
7369+
Func GUI_Uninstall()
7370+
Local $hGui = GUICreate($title, 434, 218, -1, -1)
7371+
_GuiSetColor()
7372+
_GUICtrlCreatePic($sLogoFile, 16, 16, 57, 57)
7373+
GUICtrlCreateLabel(t('UNINSTALL_TITLE'), 88, 16, 328, 28)
7374+
GUICtrlSetFont(-1, 16, 600, 0, "Arial")
7375+
GUICtrlCreateLabel(t('UNINSTALL_LABEL'), 88, 48, 326, 57)
7376+
Local $idCheckboxRemoveLogs = GUICtrlCreateCheckbox(t('UNINSTALL_REMOVE_LOGS'), 104, 118, 265, 17)
7377+
GUICtrlSetState(-1, $GUI_CHECKED)
7378+
Local $idCheckboxRemoveUserData = GUICtrlCreateCheckbox(t('UNINSTALL_REMOVE_USERDATA'), 104, 142, 265, 17)
7379+
Local $idOk = GUICtrlCreateButton(t('UNINSTALL'), 328, 176, 89, 25)
7380+
7381+
Local $hMenu = _GUICtrlMenu_GetSystemMenu($hGui)
7382+
_GUICtrlMenu_EnableMenuItem($hMenu, $SC_CLOSE, $MF_GRAYED, False)
7383+
7384+
Opt("GUIOnEventMode", 0)
7385+
GUISetState(@SW_SHOW)
7386+
7387+
While 1
7388+
If GUIGetMsg() == $idOk Then ExitLoop
7389+
WEnd
7390+
7391+
Local $bRemoveLogs = _IsChecked($idCheckboxRemoveLogs)
7392+
Local $bRemoveUserData = _IsChecked($idCheckboxRemoveUserData)
7393+
7394+
GUIDelete($hGui)
7395+
Opt("GUIOnEventMode", 1)
7396+
7397+
Uninstall($bRemoveLogs, $bRemoveUserData)
7398+
EndFunc
7399+
73537400
; Display command line help
73547401
Func GUI_CommandLineHelp()
73557402
Opt("GUIOnEventMode", 0)

devdata/Koda/Uninstall.kxf

Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
<?xml version="1.0" encoding="windows-1251"?>
2+
<object type="TAForm" name="Form1">
3+
<properties>
4+
<property name="Left" vt="Int16">437</property>
5+
<property name="Top" vt="Int16">308</property>
6+
<property name="Width" vt="Int16">449</property>
7+
<property name="Height" vt="Int16">255</property>
8+
<property name="Caption" vt="String">Form1</property>
9+
<property name="Color" vt="Ident">clBtnFace</property>
10+
<property name="Font.Charset" vt="Ident">DEFAULT_CHARSET</property>
11+
<property name="Font.Color" vt="Ident">clWindowText</property>
12+
<property name="Font.Height" vt="Int8">-11</property>
13+
<property name="Font.Name" vt="String">MS Sans Serif</property>
14+
<property name="Font.Style" vt="Set"/>
15+
<property name="OldCreateOrder" vt="False">False</property>
16+
<property name="Visible" vt="True">True</property>
17+
<property name="Style" vt="Int32">-1798701056</property>
18+
<property name="ExStyle" vt="Int16">256</property>
19+
<property name="Version" vt="String">1.04</property>
20+
<property name="FormOptOnEvent" vt="False">False</property>
21+
<property name="FormOptExpVars" vt="False">False</property>
22+
<property name="FormOptPopulate" vt="False">False</property>
23+
<property name="FormOptVarsForSet" vt="False">False</property>
24+
<property name="FormOptIndentChar" vt="Int8">0</property>
25+
<property name="FormOptIndentCount" vt="Int8">1</property>
26+
<property name="FormOptIndentInit" vt="Int8">0</property>
27+
<property name="FormOptVarScope" vt="Int8">0</property>
28+
<property name="Resizing" vt="Set"/>
29+
<property name="PixelsPerInch" vt="Int8">96</property>
30+
<property name="TextHeight" vt="Int8">13</property>
31+
</properties>
32+
<components>
33+
<object type="TAPic" name="Pic1">
34+
<properties>
35+
<property name="Left" vt="Int8">16</property>
36+
<property name="Top" vt="Int16">144</property>
37+
<property name="Width" vt="Int8">57</property>
38+
<property name="Height" vt="Int8">57</property>
39+
<property name="CtrlStyle" vt="Int32">1342308622</property>
40+
<property name="CtrlExStyle" vt="Int8">0</property>
41+
<property name="PicturePath" vt="String">C:\Users\William\Desktop\Documents\uniextract_source\support\Icons\uniextract_inno.bmp</property>
42+
<property name="TabOrder" vt="Int8">0</property>
43+
<property name="Resizing" vt="Set">DockWidth, DockHeight</property>
44+
</properties>
45+
<components/>
46+
</object>
47+
<object type="TALabel" name="Label1">
48+
<properties>
49+
<property name="Left" vt="Int8">88</property>
50+
<property name="Top" vt="Int8">16</property>
51+
<property name="Width" vt="Int16">328</property>
52+
<property name="Height" vt="Int8">28</property>
53+
<property name="Caption" vt="String">Uninstall Universal Extractor</property>
54+
<property name="Font.Charset" vt="Ident">DEFAULT_CHARSET</property>
55+
<property name="Font.Color" vt="Ident">clWindowText</property>
56+
<property name="Font.Height" vt="Int8">-19</property>
57+
<property name="Font.Name" vt="String">MS Sans Serif</property>
58+
<property name="Font.Style" vt="Set">fsBold</property>
59+
<property name="ParentFont" vt="False">False</property>
60+
<property name="TabOrder" vt="Int8">1</property>
61+
<property name="HaveVariable" vt="False">False</property>
62+
<property name="CtrlStyle" vt="Int32">1342308608</property>
63+
<property name="CtrlExStyle" vt="Int8">0</property>
64+
<property name="Resizing" vt="Set"/>
65+
</properties>
66+
<components/>
67+
</object>
68+
<object type="TAButton" name="Button1">
69+
<properties>
70+
<property name="Left" vt="Int16">328</property>
71+
<property name="Top" vt="Int16">176</property>
72+
<property name="Width" vt="Int8">89</property>
73+
<property name="Height" vt="Int8">25</property>
74+
<property name="Caption" vt="String">Uninstall</property>
75+
<property name="TabOrder" vt="Int8">2</property>
76+
<property name="Color" vt="Ident">clBtnFace</property>
77+
<property name="CtrlStyle" vt="Int32">1342373888</property>
78+
<property name="CtrlExStyle" vt="Int8">0</property>
79+
<property name="Resizing" vt="Set">DockWidth, DockHeight</property>
80+
</properties>
81+
<components/>
82+
</object>
83+
<object type="TACheckbox" name="Checkbox1">
84+
<properties>
85+
<property name="Left" vt="Int8">104</property>
86+
<property name="Top" vt="Int8">120</property>
87+
<property name="Width" vt="Int16">265</property>
88+
<property name="Height" vt="Int8">17</property>
89+
<property name="Caption" vt="String">Remove log files</property>
90+
<property name="TabOrder" vt="Int8">3</property>
91+
<property name="CtrlStyle" vt="Int32">1342242819</property>
92+
<property name="CtrlExStyle" vt="Int8">0</property>
93+
<property name="Resizing" vt="Set">DockHeight</property>
94+
</properties>
95+
<components/>
96+
</object>
97+
<object type="TACheckbox" name="Checkbox2">
98+
<properties>
99+
<property name="Left" vt="Int8">104</property>
100+
<property name="Top" vt="Int16">144</property>
101+
<property name="Width" vt="Int16">265</property>
102+
<property name="Height" vt="Int8">17</property>
103+
<property name="Caption" vt="String">Remove all user data and settings</property>
104+
<property name="TabOrder" vt="Int8">4</property>
105+
<property name="CtrlStyle" vt="Int32">1342242819</property>
106+
<property name="CtrlExStyle" vt="Int8">0</property>
107+
<property name="Resizing" vt="Set">DockHeight</property>
108+
</properties>
109+
<components/>
110+
</object>
111+
<object type="TALabel" name="Label2">
112+
<properties>
113+
<property name="Left" vt="Int8">88</property>
114+
<property name="Top" vt="Int8">48</property>
115+
<property name="Width" vt="Int16">326</property>
116+
<property name="Height" vt="Int8">57</property>
117+
<property name="Caption" vt="String">If you plan to install %name again, you can choose to keep your settings here. Otherwise, it is save to delete all user data.</property>
118+
<property name="TabOrder" vt="Int8">5</property>
119+
<property name="HaveVariable" vt="False">False</property>
120+
<property name="CtrlStyle" vt="Int32">1342308608</property>
121+
<property name="CtrlExStyle" vt="Int8">0</property>
122+
<property name="Resizing" vt="Set"/>
123+
</properties>
124+
<components/>
125+
</object>
126+
</components>
127+
</object>

lang/German.ini

660 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)