Skip to content

Commit 005df22

Browse files
committed
2 parents 565c39c + c286a45 commit 005df22

File tree

4 files changed

+92
-20
lines changed

4 files changed

+92
-20
lines changed

WingetUI.iss

Lines changed: 75 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,19 @@ UninstallDisplayName="WingetUI"
1414
AppId={{889610CC-4337-4BDB-AC3B-4F21806C0BDD}
1515
AppName={#MyAppName}
1616
AppVersion={#MyAppVersion}
17-
;AppVerName={#MyAppName} {#MyAppVersion}
17+
AppVerName={#MyAppName} {#MyAppVersion}
1818
AppPublisher={#MyAppPublisher}
19-
AppPublisherURL={#MyAppURL}
19+
AppPublisherURL='https://www.marticliment.com/'
2020
AppSupportURL={#MyAppURL}
2121
AppUpdatesURL={#MyAppURL}
2222
VersionInfoVersion=2.0.3.0
2323
DefaultDirName="{commonpf64}\WingetUI"
2424
DisableProgramGroupPage=yes
2525
DisableDirPage=no
26+
DirExistsWarning=no
2627
CloseApplications=no
2728
; Remove the following line to run in administrative install mode (install for all users.)
28-
PrivilegesRequired=lowest
29+
;PrivilegesRequired=lowest
2930
OutputBaseFilename=WingetUI Installer
3031
OutputDir=.
3132
MinVersion=10.0
@@ -37,7 +38,10 @@ WizardStyle=classic
3738
WizardImageFile=INSTALLER.BMP
3839
WizardSmallImageFile=wingetui\resources\icon.bmp
3940
DisableWelcomePage=no
40-
UsePreviousTasks=yes
41+
AllowUNCPath=no
42+
UsePreviousTasks=yes
43+
UsePreviousPrivileges=no
44+
UsePreviousAppDir=no
4145
ChangesEnvironment=yes
4246
RestartIfNeededByRun=no
4347
Uninstallable=IsTaskSelected('regularinstall')
@@ -70,19 +74,42 @@ Name: "Ukrainian"; MessagesFile: "compiler:Languages\Ukrainian.isl"
7074
Name: "Korean"; MessagesFile: "compiler:Languages\Korean.isl"
7175

7276
[InstallDelete]
73-
Type: filesandordirs; Name: "{autopf}\WingetUI\*.pyc"; BeforeInstall: TripleKill('WingetUI.exe', 'winget.exe', 'choco.exe');
74-
Type: filesandordirs; Name: "{autopf}\WingetUI\PySide6\*"; BeforeInstall: TripleKill('WingetUI.exe', 'winget.exe', 'choco.exe');
75-
Type: filesandordirs; Name: "{autopf}\WingetUI\pip-23.0.dist-info";
76-
Type: filesandordirs; Name: "{autopf}\WingetUI\pip-23.1.2.dist-info";
77-
Type: filesandordirs; Name: "{autopf}\WingetUI\setuptools-65.5.0.dist-info";
78-
Type: filesandordirs; Name: "{autopf}\WingetUI\sudo";
79-
Type: filesandordirs; Name: "{autopf}\WingetUI\*.pyc";
80-
Type: filesandordirs; Name: "{autopf}\WingetUI\winget-cli\*";
81-
Type: filesandordirs; Name: "{autopf}\WingetUI\resources\*";
77+
Type: filesandordirs; Name: "{userpf}\WingetUI\*.pyc"; BeforeInstall: TripleKill('WingetUI.exe', 'winget.exe', 'choco.exe');
78+
Type: filesandordirs; Name: "{userpf}\WingetUI\PySide6\*"; BeforeInstall: TripleKill('WingetUI.exe', 'winget.exe', 'choco.exe');
79+
Type: filesandordirs; Name: "{userpf}\WingetUI\clr_loader\*";
80+
Type: filesandordirs; Name: "{userpf}\WingetUI\components\*";
81+
Type: filesandordirs; Name: "{userpf}\WingetUI\data\*";
82+
Type: filesandordirs; Name: "{userpf}\WingetUI\lang\*";
83+
Type: filesandordirs; Name: "{userpf}\WingetUI\markupsafe\*";
84+
Type: filesandordirs; Name: "{userpf}\WingetUI\PackageManagers\*";
85+
Type: filesandordirs; Name: "{userpf}\WingetUI\PySide6\*";
86+
Type: filesandordirs; Name: "{userpf}\WingetUI\pythonnet\*";
87+
Type: filesandordirs; Name: "{userpf}\WingetUI\pywin32_system32\*";
88+
Type: filesandordirs; Name: "{userpf}\WingetUI\resources\*";
89+
Type: filesandordirs; Name: "{userpf}\WingetUI\shiboken6\*";
90+
Type: filesandordirs; Name: "{userpf}\WingetUI\winsdk\*";
91+
Type: filesandordirs; Name: "{userpf}\WingetUI\pip-23.1.2.dist-info";
92+
Type: filesandordirs; Name: "{userpf}\WingetUI\setuptools-65.5.0.dist-info";
93+
Type: filesandordirs; Name: "{userpf}\WingetUI\sudo\*";
94+
Type: filesandordirs; Name: "{userpf}\WingetUI\winget-cli\*";
95+
Type: filesandordirs; Name: "{userpf}\WingetUI\resources\*";
96+
Type: filesandordirs; Name: "{userpf}\WingetUI\resources\*.pyd";
97+
Type: filesandordirs; Name: "{userpf}\WingetUI\resources\api-ms-win*.dll";
98+
Type: filesandordirs; Name: "{userpf}\WingetUI\resources\python*.dll";
99+
Type: filesandordirs; Name: "{userpf}\WingetUI\resources\wingetui.exe";
100+
Type: filesandordirs; Name: "{app}\*.pyc"; BeforeInstall: TripleKill('WingetUI.exe', 'winget.exe', 'choco.exe');
101+
Type: filesandordirs; Name: "{app}\PySide6\*"; BeforeInstall: TripleKill('WingetUI.exe', 'winget.exe', 'choco.exe');
102+
Type: filesandordirs; Name: "{app}\pip-23.0.dist-info";
103+
Type: filesandordirs; Name: "{app}\pip-23.1.2.dist-info";
104+
Type: filesandordirs; Name: "{app}\setuptools-65.5.0.dist-info";
105+
Type: filesandordirs; Name: "{app}\sudo";
106+
Type: filesandordirs; Name: "{app}\winget-cli\*";
107+
Type: filesandordirs; Name: "{app}\resources\*";
82108
Type: filesandordirs; Name: "{username}\WingetUI\resources\*";
83109

84110
[UninstallDelete]
85-
Type: filesandordirs; Name: "{autopf}\WingetUI\*"; BeforeInstall: TripleKill('WingetUI.exe', 'winget.exe', 'choco.exe');
111+
Type: filesandordirs; Name: "{userpf}\WingetUI\*"; BeforeInstall: TripleKill('WingetUI.exe', 'winget.exe', 'choco.exe');
112+
Type: filesandordirs; Name: "{app}\*"; BeforeInstall: TripleKill('WingetUI.exe', 'winget.exe', 'choco.exe');
86113

87114
[Code]
88115
procedure InitializeWizard;
@@ -161,6 +188,36 @@ begin
161188
end;
162189
end;
163190
191+
function IsCharValid(Value: Char): Boolean;
192+
begin
193+
Result := Ord(Value) <= $007F;
194+
end;
195+
196+
function IsDirNameValid(const Value: string): Boolean;
197+
var
198+
I: Integer;
199+
begin
200+
Result := False;
201+
for I := 1 to Length(Value) do
202+
if not IsCharValid(Value[I]) then
203+
Exit;
204+
Result := True;
205+
end;
206+
207+
function NextButtonClick(CurPageID: Integer): Boolean;
208+
begin
209+
Result := True;
210+
211+
if (CurPageID = wpSelectDir) and
212+
not IsDirNameValid(WizardForm.DirEdit.Text) then
213+
begin
214+
Result := False;
215+
MsgBox('There is an invalid character in the selected install location. ' +
216+
'Install location cannot contain special characters. ' +
217+
'Please input a valid path to continue, such as '+ExpandConstant('{commonpf64}')+'\WingetUI', mbError, MB_OK);
218+
end;
219+
end;
220+
164221
165222
[Tasks]
166223
Name: "portableinstall"; Description: "Perform a portable installation"; GroupDescription: "Installation type"; Flags: unchecked exclusive
@@ -174,13 +231,15 @@ Root: HKCU; Subkey: "SOFTWARE\Microsoft\Windows\CurrentVersion\Run"; ValueType:
174231
[Files]
175232
Source: "Y:\WinGetUI-Store\wingetuiBin\{#MyAppExeName}"; DestDir: "{app}"; Flags: ignoreversion; BeforeInstall: TripleKill('WingetUI.exe', 'winget.exe', 'choco.exe');
176233
Source: "Y:\WinGetUI-Store\wingetuiBin\*"; DestDir: "{app}"; Flags: createallsubdirs ignoreversion recursesubdirs;
234+
Source: "Y:\WinGetUI-Store\wingetuiBin\choco-cli\*"; DestDir: "{userpf}\WingetUI\choco-cli"; Flags: createallsubdirs ignoreversion recursesubdirs; Tasks: regularinstall
235+
177236
; MSVC++ redistributable runtime. Extracted by VC2017RedistNeedsInstall(), if needed.
178237
Source: "Y:\WinGetUI-Store\vcredist.exe"; DestDir: {tmp}; Flags: dontcopy
179238
Source: "Y:\WinGetUI-Store\SegUIVar.ttf"; DestDir: "{autofonts}"; FontInstall: "Segoe UI Variable"; Flags: onlyifdoesntexist uninsneveruninstall
180239

181240
[Icons]
182-
Name: "{autostartmenu}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: regularinstall\startmenuicon
183-
Name: "{autodesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: regularinstall\desktopicon
241+
Name: "{userstartmenu}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: regularinstall\startmenuicon
242+
Name: "{userdesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: regularinstall\desktopicon
184243

185244
[Run]
186245
Filename: "{tmp}\vcredist.exe"; Flags: runhidden; Parameters: "/install /norestart /passive"; StatusMsg: "Installing Microsoft Visual C++ Redistributables (x64)"; Check: VCRedistNeedsInstall and not CmdLineParamExists('/NoVCRedist');

wingetui/PackageManagers/choco.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,16 @@
1515
class ChocoPackageManager(SamplePackageManager):
1616

1717
if getSettings("UseSystemChocolatey"):
18+
print("🟡 System chocolatey used")
1819
EXECUTABLE = "choco.exe"
1920
else:
20-
EXECUTABLE = os.path.join(os.path.join(realpath, "choco-cli"), "choco.exe")
21+
possiblePath = os.path.join(os.path.expanduser("~"), "AppData/Local/Programs/WingetUI/choco-cli/choco.exe")
22+
if os.path.isfile(possiblePath):
23+
print("🔵 Found default chocolatey installation on expected location")
24+
EXECUTABLE = possiblePath
25+
else:
26+
print("🟡 Chocolatey was not found on the default location, perhaps a portable WingetUI installation?")
27+
EXECUTABLE = os.path.join(os.path.join(realpath, "choco-cli"), "choco.exe")
2128
os.environ["chocolateyinstall"] = os.path.dirname(EXECUTABLE)
2229

2330
icon = None

wingetui/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import faulthandler
66
faulthandler.enable()
77

8-
pathIsValid = False
8+
pathIsValid = True
99
specialCharacter = ""
1010
for char in sys.executable:
1111
if char not in "\\/:abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSRTUVWXYZ1234567890_+()-., ":
@@ -14,7 +14,7 @@
1414
break
1515
if not pathIsValid:
1616
import win32api
17-
win32api.MessageBox(None, "WingetUI can't be installed in a path containing special characters. Please reinstall WingetUI on a valid location\n\n\nCurrent path: "+os.path.dirname(sys.executable)+"\nInvalid character detected: "+specialCharacter+"\n\n\nPlease run the WingetUI installer and select a different install location. A possible valid path could be C:\WingetUI", "WingetUI Crash handler", 0x00000010)
17+
win32api.MessageBox(None, "WingetUI can't be installed in a path containing special characters. Please reinstall WingetUI on a valid location\n\n\nCurrent path: "+os.path.dirname(sys.executable)+"\nInvalid character detected: "+specialCharacter+"\n\n\nPlease run the WingetUI installer and select a different install location. A possible valid path could be C:\Program Files\WingetUI", "WingetUI Crash handler", 0x00000010)
1818
sys.exit(1)
1919

2020

wingetui/data/contributors.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
"elliot-100",
1717
"neoOpus",
1818
"Satanarious",
19+
"vsilvar",
1920
"quantumfallout",
2021
"derula",
2122
"flatron4eg",
@@ -28,7 +29,7 @@
2829
{
2930
"name": "marticliment",
3031
"link": "https://github.com/marticliment",
31-
"contributions": 1737
32+
"contributions": 1741
3233
},
3334
{
3435
"name": "ppvnf",
@@ -100,6 +101,11 @@
100101
"link": "https://github.com/Satanarious",
101102
"contributions": 1
102103
},
104+
{
105+
"name": "vsilvar",
106+
"link": "https://github.com/vsilvar",
107+
"contributions": 1
108+
},
103109
{
104110
"name": "quantumfallout",
105111
"link": "https://github.com/quantumfallout",

0 commit comments

Comments
 (0)