Skip to content

Commit

Permalink
added inno setup, fixed license
Browse files Browse the repository at this point in the history
  • Loading branch information
infeeeee committed Jul 27, 2019
1 parent 4058ee0 commit 30c287e
Show file tree
Hide file tree
Showing 6 changed files with 120 additions and 22 deletions.
6 changes: 1 addition & 5 deletions LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,4 @@ 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
<<<<<<< HEAD
SOFTWARE.
=======
SOFTWARE.
>>>>>>> 2ffa9275ad4ec845877c772c2b5097db51a797c7
SOFTWARE.
30 changes: 16 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,32 +21,29 @@ UI:

Integration:
- [x] Portable executable for all three platforms
- [ ] Installer for windows
- [x] Installer for windows
- [ ] Generate output for Rainmeter (Windows) (Just like [kimai-cmd](https://github.com/infeeeee/kimai-cmd))
- [x] Generate output for Argos/Kargos/Bitbar (Gnome, Kde, Mac). More info here: [kimai2-cmd-argos](https://github.com/infeeeee/kimai2-cmd-argos)

Requests for integrations with other softwares are welcomed! Just open an issue and show an example output, what you need.

## Installation

Download executable from [releases](https://github.com/infeeeee/kimai2-cmd/releases/latest). Standalone executable, no installation required.
Download from [releases](https://github.com/infeeeee/kimai2-cmd/releases/latest).

You have to create an API password for your username on your Kimai installation. In Kimai: User menu (Top right corner) -> User profile -> API
You have to create an API password for your username on your Kimai installation. In Kimai: User menu (Top right corner) -> User profile -> API.

### Notes on Windows

Add the path of the containing folder to the %PATH% environment variable so you can run it from command line/powershell system wide. I didn't find any reliable way to do this from command line, so follow this guide. It should work on win 7-10
Portable executable or installer available.

- Open start menu and type: SystemPropertiesAdvanced.exe
- Go to Advanced tab click Environment variables
- Select path on the top pane, click Edit
- On win 7,8 add the following to the end of the variable: `;c:\path\to\containing\folder`
- On win 10 click New and type `c:\path\to\containing\folder`
- Log off and on if not working
Installer automatically adds the install path to the %PATH% environment variable, so you can use it from command line/powershell system wide. Sign out and in if it's not working.

With the portable version you have to do this manually. Follow [this tutorial](https://stackoverflow.com/questions/44272416/how-to-add-a-folder-to-path-environment-variable-in-windows-10-with-screensho) or a similar one if you don't know how to do it.

### Notes on Linux/Mac

On the following terminal examples use the file name you downloaded.
Portable executable only. On the following terminal examples use the file name you downloaded.

Make the downloaded binary executable:
```
Expand Down Expand Up @@ -123,7 +120,7 @@ Integration settings are not asked during first run, you have to change them man

### Installation

requirements:
Prerequisites:
- node js 10+
- git

Expand All @@ -135,7 +132,7 @@ npm install

### Build

Requirements: globally installed [pkg](https://github.com/zeit/pkg):
Prerequisite: globally installed [pkg](https://github.com/zeit/pkg):

```
npm install pkg -g
Expand All @@ -147,7 +144,6 @@ Build for current platform and architecture
npm run build-current
```


Build x64 executables for linux, mac on linux or on mac

```
Expand All @@ -156,6 +152,12 @@ npm run build-nix

About building for other platforms see pkg's documentation, or open an issue and I can build it for you.

### Installer (Windows only)

Prerequisite: [Inno Setup](http://www.jrsoftware.org/isinfo.php)

- Create a windows build: `npm run build-current`
- Open `kimai2-innosetup.iss` in Inno Setup

### Usage

Expand Down
Binary file added assets/kimai-icon-192x192.ico
Binary file not shown.
Binary file added assets/kimai-icon-192x192.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
100 changes: 100 additions & 0 deletions kimai2-innosetup.iss
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;
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 30c287e

Please sign in to comment.