Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions src/Installer/associate_file_extension.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
rem I Language windows file extension associate tool.
rem Version: 1.0.0
rem
rem Copyright (c) 2023-present I Language Development.
rem
rem Permission is hereby granted, free of charge, to any person obtaining a
rem copy of this software and associated documentation files (the 'Software'),
rem to deal in the Software without restriction, including without limitation
rem the rights to use, copy, modify, merge, publish, distribute, sublicense,
rem and/or sell copies of the Software, and to permit persons to whom the
rem Software is furnished to do so, subject to the following conditions:
rem
rem The above copyright notice and this permission notice shall be included in
rem all copies or substantial portions of the Software.
rem
rem THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS
rem OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
rem FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
rem AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
rem LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
rem FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
rem DEALINGS IN THE SOFTWARE.

@echo off

rem Run as new process with administrator privileges
net session >nul 2>&1 || (powershell start -verb runas '"%~0"' %1 & exit /b)

rem Global registry path
set registry_path="HKEY_LOCAL_MACHINE\Software\CLASSES"

rem Add file extension to registry
reg add "%registry_path%\ILanguage" /d "I Language File" /f
reg add "%registry_path%\ILanguage" /v "AppUserModelID" /d "ILanguage.ILanguage" /f
reg add "%registry_path%\ILanguage\DefaultIcon" /d "%PROGRAMFILES%\ilanguage\file_icon.ico" /f
reg add "%registry_path%\ILanguage\Shell\open\command" /d "%PROGRAMFILES%\ilanguage\shell.exe" /f
reg add "%registry_path%\.il" /d "ILanguage" /f
reg add "%registry_path%\.il" /v "Content Type" /d "text/plain" /f
reg add "%registry_path%\.il\OpenWithProgids" /d "ILanguage" /f
89 changes: 89 additions & 0 deletions src/Installer/setup.iss
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
; I Language windows installer.
; Version: 1.0.0
;
; Copyright (c) 2023-present I Language Development.
;
; Permission is hereby granted, free of charge, to any person obtaining a
; copy of this software and associated documentation files (the 'Software'),
; to deal in the Software without restriction, including without limitation
; the rights to use, copy, modify, merge, publish, distribute, sublicense,
; and/or sell copies of the Software, and to permit persons to whom the
; Software is furnished to do so, subject to the following conditions:
;
; The above copyright notice and this permission notice shall be included in
; all copies or substantial portions of the Software.
;
; THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS
; OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
; FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
; AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
; LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
; FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
; DEALINGS IN THE SOFTWARE.
;
; Some of this code is copied from the inno setup installer.


[Setup]
AppName=I Language
AppId=ILanguage
AppVersion=1.0.0
AppPublisher=I Language Development
AppPublisherURL=https://www.i-language-development.github.io/
AppSupportURL=https://www.i-language-development.github.io/
AppUpdatesURL=https://www.i-language-development.github.io/
VersionInfoCopyright=Copyright (c) 2023-present I Language Development.
AppMutex=ILanguageSetupMutex,Global\ILanguageSetupMutex
SetupMutex=ILanguageSetupMutex,Global\ILanguageSetupMutex
WizardStyle=modern
DefaultDirName={code:GetDefaultDirName|I Language}
DefaultGroupName=I Language
PrivilegesRequiredOverridesAllowed=commandline
AllowNoIcons=yes
Compression=lzma2/max
SolidCompression=yes
Uninstallable=not PortableCheck
UninstallDisplayIcon={app}\Uninstall.exe
UsePreviousLanguage=no
LicenseFile=LICENSE

[Languages]
Name: english; MessagesFile: "Translations\default.isl"

[Messages]
english.WelcomeLabel1=Welcome to the I Language installer

[Tasks]
Name: installforallusers; Description: "{cm:InstallForAllUsers}"; Flags: unchecked; Check: not PortableCheck
Name: desktopicon; Description: "{cm:CreateDesktopIcon}"; Flags: unchecked; Check: not PortableCheck
Name: fileassoc; Description: "{cm:AssocFileExtension,I Language,.il}"; Check: not PortableCheck

[InstallDelete]
Type: files; Name: {autodesktop}\I Language.lnk; Tasks: not desktopicon; Check: not PortableCheck
Type: filesandordirs; Name: "{app}\src\Installer"
Type: filesandordirs; Name: "{app}\Translations\Installer"

[Files]
Source: "LICENSE"; DestDir: "{app}"; Flags: ignoreversion touch
; Todo (ElBe): Make README html
Source: ".github\README.md"; DestDir: "{app}"; Flags: ignoreversion touch isreadme
Source: "Modules\*"; DestDir: "{app}\Modules\stdlib"; Flags: ignoreversion touch
Source: "Docs\*"; DestDir: "{app}\Docs"; Flags: ignoreversion touch
Source: "src\Installer\*.bat"; DestDir: "{app}"; Flags: ignoreversion touch

[INI]
Filename: "{app}\config.ini"; Section: "Settings"; Key: "Path"; String: "{app}"

[UninstallDelete]
Type: files; Name: "{app}\config.ini"
Type: filesandordirs; Name: "{app}\Modules"

[Icons]
; Todo (ElBe): Add icons
; Comming soon

[Run]
Filename: "{app}\associate_file_extension.bat"; StatusMsg: "{cm:AssocingFileExtension,I Language,.il}"; Tasks: fileassoc

[UninstallRun]
Filename: "{app}\unassociate_file_extension.bat"
34 changes: 34 additions & 0 deletions src/Installer/unasociate_file_extension.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
rem I Language windows file extension unassociate tool.
rem Version: 1.0.0
rem
rem Copyright (c) 2023-present I Language Development.
rem
rem Permission is hereby granted, free of charge, to any person obtaining a
rem copy of this software and associated documentation files (the 'Software'),
rem to deal in the Software without restriction, including without limitation
rem the rights to use, copy, modify, merge, publish, distribute, sublicense,
rem and/or sell copies of the Software, and to permit persons to whom the
rem Software is furnished to do so, subject to the following conditions:
rem
rem The above copyright notice and this permission notice shall be included in
rem all copies or substantial portions of the Software.
rem
rem THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS
rem OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
rem FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
rem AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
rem LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
rem FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
rem DEALINGS IN THE SOFTWARE.

@echo off

rem Run as new process with administrator privileges
net session >nul 2>&1 || (powershell start -verb runas '"%~0"' %1 & exit /b)

rem Global registry path
set registry_path="HKEY_LOCAL_MACHINE\Software\CLASSES"

rem Remove file extension from registry
reg delete "%registry_path%\ILanguage" /f
reg delete "%registry_path%\.il" /f