-
Notifications
You must be signed in to change notification settings - Fork 1
Release/v1.1 #8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Release/v1.1 #8
Changes from 2 commits
523928d
efd7dd2
5f10b80
6834dd2
ded9fe1
b7630af
00a160b
bc73479
c4fd24c
ff2b64b
d1b2381
cbe758f
f8dec15
01f08ff
5c2b93f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,14 +1,15 @@ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ; Frontend Installation Header | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| !define FRONTEND_URL "https://github.com/AymurAI/desktop-app/releases/download/1.20.2/AymurAI-win32-x64-1-20-2.zip" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| !define ARCHIVO_FONT "..\resources\Archivo-Regular.ttf" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| !macro InstallFrontend | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ; Check if frontend is already installed | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| IfFileExists "$INSTDIR\${APP_NAME}.exe" frontend_skip_download frontend_download | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| frontend_skip_download: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| DetailPrint "Frontend is already installed." | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Goto finish | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Goto install_archivo_font | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| frontend_download: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ; Set output path | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -57,7 +58,30 @@ | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| frontend_success: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| DetailPrint "Frontend installation successful." | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| install_archivo_font: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ; Check if any Archivo font already exists in Windows Fonts | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| nsExec::ExecToStack 'powershell -NoProfile -ExecutionPolicy Bypass -Command "$props = (Get-ItemProperty -Path \"HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts\").PSObject.Properties.Name | Where-Object { $_ -like \"Archivo*\" }; if ($props) { exit 0 } else { exit 1 }"' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Pop $0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| StrCmp $0 "0" finish archivo_font_install | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. issue (bug_risk): PowerShell registry check may require elevation and could fail silently. Since HKLM access often requires admin rights, the registry check may fail or give incorrect results if run without elevation. Please ensure permission errors are detected and communicated to the user. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| archivo_font_install: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ; Copy Archivo font file | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| DetailPrint "Installing Archivo font..." | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| SetOutPath $INSTDIR | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| File "${ARCHIVO_FONT}" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ; Copy Archivo font file to Windows Fonts | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| nsExec::ExecToLog 'powershell -NoProfile -ExecutionPolicy Bypass -Command "Copy-Item -Path \"$INSTDIR\Archivo-Regular.ttf\" -Destination \"C:\Windows\Fonts\" -Force"' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. issue (bug_risk): Copying directly to C:\Windows\Fonts may fail without admin rights. Check for administrator privileges before copying the font, or implement a fallback if elevation is not available.
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| nsExec::ExecToLog 'powershell -NoProfile -ExecutionPolicy Bypass -Command "Copy-Item -Path \"$INSTDIR\Archivo-Regular.ttf\" -Destination \"C:\Windows\Fonts\" -Force"' | |
| nsExec::ExecToLog 'powershell -NoProfile -ExecutionPolicy Bypass -Command "Copy-Item -Path \"$INSTDIR\Archivo-Regular.ttf\" -Destination \"$env:SystemRoot\Fonts\" -Force"' |
Copilot
AI
Aug 8, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Modifying HKLM registry requires administrator privileges. The installation should verify elevated permissions before attempting registry modifications, or handle potential access denied errors gracefully.
| archivo_font_install: | |
| ; Copy Archivo font file | |
| DetailPrint "Installing Archivo font..." | |
| SetOutPath $INSTDIR | |
| File "${ARCHIVO_FONT}" | |
| ; Copy Archivo font file to Windows Fonts | |
| nsExec::ExecToLog 'powershell -NoProfile -ExecutionPolicy Bypass -Command "Copy-Item -Path \"$INSTDIR\Archivo-Regular.ttf\" -Destination \"C:\Windows\Fonts\" -Force"' | |
| ; Add registry entry for the font | |
| nsExec::ExecToLog 'powershell -NoProfile -ExecutionPolicy Bypass -Command "New-ItemProperty -Path \"HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts\" -Name \"Archivo (TrueType)\" -PropertyType String -Value \"Archivo-Regular.ttf\" -Force"' | |
| DetailPrint "Archivo font installed successfully." | |
| ; Remove Archivo font file | |
| DetailPrint "Removing temporary Archivo font file..." | |
| Delete "$INSTDIR\Archivo-Regular.ttf" | |
| archivo_font_install: | |
| ; Check for administrator privileges before modifying HKLM | |
| UserInfo::GetAccountType | |
| Pop $0 | |
| StrCmp $0 "admin" 0 not_admin | |
| ; Copy Archivo font file | |
| DetailPrint "Installing Archivo font..." | |
| SetOutPath $INSTDIR | |
| File "${ARCHIVO_FONT}" | |
| ; Copy Archivo font file to Windows Fonts | |
| nsExec::ExecToLog 'powershell -NoProfile -ExecutionPolicy Bypass -Command "Copy-Item -Path \"$INSTDIR\Archivo-Regular.ttf\" -Destination \"C:\Windows\Fonts\" -Force"' | |
| ; Add registry entry for the font | |
| nsExec::ExecToStack 'powershell -NoProfile -ExecutionPolicy Bypass -Command "New-ItemProperty -Path \"HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts\" -Name \"Archivo (TrueType)\" -PropertyType String -Value \"Archivo-Regular.ttf\" -Force"' | |
| Pop $1 | |
| StrCmp $1 "0" font_reg_success font_reg_fail | |
| font_reg_fail: | |
| MessageBox MB_OK|MB_ICONEXCLAMATION "Failed to add font registry entry. Please run the installer as administrator." | |
| Abort | |
| font_reg_success: | |
| DetailPrint "Archivo font installed successfully." | |
| ; Remove Archivo font file | |
| DetailPrint "Removing temporary Archivo font file..." | |
| Delete "$INSTDIR\Archivo-Regular.ttf" | |
| Goto finish | |
| not_admin: | |
| MessageBox MB_OK|MB_ICONEXCLAMATION "Administrator privileges are required to install the Archivo font. Please run the installer as administrator." | |
| Abort | |
Copilot
AI
Aug 8, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The font file is copied to $INSTDIR temporarily and then deleted. Consider copying directly to the destination to avoid unnecessary file operations and potential cleanup issues if the installation fails.
| SetOutPath $INSTDIR | |
| File "${ARCHIVO_FONT}" | |
| ; Copy Archivo font file to Windows Fonts | |
| nsExec::ExecToLog 'powershell -NoProfile -ExecutionPolicy Bypass -Command "Copy-Item -Path \"$INSTDIR\Archivo-Regular.ttf\" -Destination \"C:\Windows\Fonts\" -Force"' | |
| ; Add registry entry for the font | |
| nsExec::ExecToLog 'powershell -NoProfile -ExecutionPolicy Bypass -Command "New-ItemProperty -Path \"HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts\" -Name \"Archivo (TrueType)\" -PropertyType String -Value \"Archivo-Regular.ttf\" -Force"' | |
| DetailPrint "Archivo font installed successfully." | |
| ; Remove Archivo font file | |
| DetailPrint "Removing temporary Archivo font file..." | |
| Delete "$INSTDIR\Archivo-Regular.ttf" | |
| ; Copy Archivo font file to Windows Fonts | |
| nsExec::ExecToLog 'powershell -NoProfile -ExecutionPolicy Bypass -Command "Copy-Item -Path \"${ARCHIVO_FONT}\" -Destination \"C:\Windows\Fonts\" -Force"' | |
| ; Add registry entry for the font | |
| nsExec::ExecToLog 'powershell -NoProfile -ExecutionPolicy Bypass -Command "New-ItemProperty -Path \"HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts\" -Name \"Archivo (TrueType)\" -PropertyType String -Value \"Archivo-Regular.ttf\" -Force"' | |
| DetailPrint "Archivo font installed successfully." | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using
-ExecutionPolicy Bypassdisables PowerShell's execution policy security feature. Consider using a more restrictive execution policy or implementing alternative font detection methods.