diff --git a/LICENSE b/LICENSE index d417f94..dd181be 100644 --- a/LICENSE +++ b/LICENSE @@ -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. \ No newline at end of file diff --git a/README.md b/README.md index 0f1518b..716bddb 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ 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) @@ -29,24 +29,21 @@ Requests for integrations with other softwares are welcomed! Just open an issue ## 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: ``` @@ -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 @@ -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 @@ -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 ``` @@ -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 diff --git a/assets/kimai-icon-192x192.ico b/assets/kimai-icon-192x192.ico new file mode 100644 index 0000000..470dec6 Binary files /dev/null and b/assets/kimai-icon-192x192.ico differ diff --git a/assets/kimai-icon-192x192.png b/assets/kimai-icon-192x192.png new file mode 100644 index 0000000..a22c770 Binary files /dev/null and b/assets/kimai-icon-192x192.png differ diff --git a/kimai2-innosetup.iss b/kimai2-innosetup.iss new file mode 100644 index 0000000..3095e90 --- /dev/null +++ b/kimai2-innosetup.iss @@ -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; diff --git a/package-lock.json b/package-lock.json index 9d44e10..361738f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -351,9 +351,9 @@ } }, "lodash": { - "version": "4.17.11", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz", - "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==" + "version": "4.17.15", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", + "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==" }, "mime-db": { "version": "1.40.0",