-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from infeeeee/dev
Added inno setup, padded time output
- Loading branch information
Showing
8 changed files
with
162 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
; Script generated by the Inno Script Studio Wizard. | ||
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES! | ||
|
||
[Setup] | ||
; NOTE: The value of AppId uniquely identifies this application. | ||
; Do not use the same AppId value in installers for other applications. | ||
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.) | ||
AppId={{A10BF7B2-6641-4B06-9C68-268B649FCE57} | ||
AppName=kimai2-cmd | ||
AppVersion=0.2.4 | ||
AppPublisher=infeeeee | ||
AppPublisherURL=https://github.com/infeeeee/kimai2-cmd | ||
AppSupportURL=https://github.com/infeeeee/kimai2-cmd | ||
AppUpdatesURL=https://github.com/infeeeee/kimai2-cmd | ||
DefaultDirName={pf}\kimai2-cmd | ||
DefaultGroupName=kimai2-cmd | ||
AllowNoIcons=yes | ||
LicenseFile={#SourcePath}\LICENSE | ||
OutputDir={#SourcePath}\builds | ||
OutputBaseFilename=kimai2-cmd-setup | ||
SetupIconFile={#SourcePath}\assets\kimai-icon-192x192.ico | ||
Compression=lzma | ||
SolidCompression=yes | ||
ArchitecturesInstallIn64BitMode=x64 | ||
ArchitecturesAllowed=x64 | ||
|
||
[Tasks] | ||
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked | ||
|
||
[Files] | ||
Source: "builds\kimai2-cmd.exe"; DestDir: "{app}"; Flags: ignoreversion | ||
; NOTE: Don't use "Flags: ignoreversion" on any shared system files | ||
Source: "settings.ini.example"; DestDir: "{userappdata}\kimai2-cmd"; DestName: "settings.ini"; Flags: onlyifdoesntexist uninsneveruninstall recursesubdirs; AfterInstall: InitializeWizard | ||
|
||
[Icons] | ||
Name: "{group}\kimai2-cmd"; Filename: "{app}\kimai2-cmd.exe" | ||
Name: "{group}\{cm:UninstallProgram,kimai2-cmd}"; Filename: "{uninstallexe}" | ||
Name: "{commondesktop}\kimai2-cmd"; Filename: "{app}\kimai2-cmd.exe"; Tasks: desktopicon | ||
|
||
[Run] | ||
Filename: "{app}\kimai2-cmd.exe"; Description: "{cm:LaunchProgram,kimai2-cmd}"; Flags: nowait postinstall skipifsilent | ||
|
||
[INI] | ||
Filename: "{userappdata}\kimai2-cmd\settings.ini"; Section: "serversettings"; Key: "kimaiurl"; String: "{code:GetKimaiUrl}" | ||
Filename: "{userappdata}\kimai2-cmd\settings.ini"; Section: "serversettings"; Key: "username"; String: "{code:GetUserName}" | ||
Filename: "{userappdata}\kimai2-cmd\settings.ini"; Section: "serversettings"; Key: "password"; String: "{code:GetPassword}" | ||
|
||
[Registry] | ||
Root: HKLM; Subkey: "SYSTEM\CurrentControlSet\Control\Session Manager\Environment"; \ | ||
ValueType: expandsz; ValueName: "Path"; ValueData: "{olddata};{app}"; \ | ||
Check: NeedsAddPath(ExpandConstant('{app}')) | ||
|
||
[Code] | ||
var AuthPage: TInputQueryWizardPage; | ||
procedure InitializeWizard; | ||
begin | ||
AuthPage := CreateInputQueryPage(wpInstalling, | ||
'Kimai2 settings', 'Please enter your server url and account information', | ||
''); | ||
AuthPage.Add('Kimai2 url:', False); | ||
AuthPage.Add('Username:', False); | ||
AuthPage.Add('API password:', False); | ||
end; | ||
function AuthForm_NextButtonClick(Page: TWizardPage): Boolean; | ||
begin | ||
Result := True; | ||
end; | ||
function GetKimaiUrl(Param: String): string; | ||
begin | ||
result := AuthPage.Values[0]; | ||
end; | ||
function GetUserName(Param: String): string; | ||
begin | ||
result := AuthPage.Values[1]; | ||
end; | ||
function GetPassword(Param: String): string; | ||
begin | ||
result := AuthPage.Values[2]; | ||
end; | ||
function NeedsAddPath(Param: string): boolean; | ||
var | ||
OrigPath: string; | ||
begin | ||
if not RegQueryStringValue(HKEY_LOCAL_MACHINE, | ||
'SYSTEM\CurrentControlSet\Control\Session Manager\Environment', | ||
'Path', OrigPath) | ||
then begin | ||
Result := True; | ||
exit; | ||
end; | ||
{ look for the path with leading and trailing semicolon } | ||
{ Pos() returns 0 if not found } | ||
Result := Pos(';' + Param + ';', ';' + OrigPath + ';') = 0; | ||
end; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters