commit
d7cb65aeaa
2
Cargo.lock
generated
2
Cargo.lock
generated
|
@ -329,7 +329,7 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "espanso"
|
name = "espanso"
|
||||||
version = "0.2.1"
|
version = "0.2.2"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"backtrace 0.3.37 (registry+https://github.com/rust-lang/crates.io-index)",
|
"backtrace 0.3.37 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"chrono 0.4.9 (registry+https://github.com/rust-lang/crates.io-index)",
|
"chrono 0.4.9 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
[package]
|
[package]
|
||||||
name = "espanso"
|
name = "espanso"
|
||||||
version = "0.2.1"
|
version = "0.2.2"
|
||||||
authors = ["Federico Terzi <federicoterzi96@gmail.com>"]
|
authors = ["Federico Terzi <federicoterzi96@gmail.com>"]
|
||||||
license = "GPL-3.0"
|
license = "GPL-3.0"
|
||||||
description = "Cross-platform Text Expander written in Rust"
|
description = "Cross-platform Text Expander written in Rust"
|
||||||
|
|
|
@ -59,6 +59,8 @@ HBITMAP g_espanso_bmp = NULL;
|
||||||
HICON g_espanso_ico = NULL;
|
HICON g_espanso_ico = NULL;
|
||||||
NOTIFYICONDATA nid = {};
|
NOTIFYICONDATA nid = {};
|
||||||
|
|
||||||
|
UINT WM_TASKBARCREATED = RegisterWindowMessage(L"TaskbarCreated");
|
||||||
|
|
||||||
// Callbacks
|
// Callbacks
|
||||||
|
|
||||||
KeypressCallback keypress_callback = NULL;
|
KeypressCallback keypress_callback = NULL;
|
||||||
|
@ -258,6 +260,9 @@ LRESULT CALLBACK window_procedure(HWND window, unsigned int msg, WPARAM wp, LPAR
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
|
if (msg == WM_TASKBARCREATED) { // Explorer crashed, recreate the icon
|
||||||
|
Shell_NotifyIcon(NIM_ADD, &nid);
|
||||||
|
}
|
||||||
return DefWindowProc(window, msg, wp, lp);
|
return DefWindowProc(window, msg, wp, lp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,6 +6,7 @@ import hashlib
|
||||||
import click
|
import click
|
||||||
import shutil
|
import shutil
|
||||||
import toml
|
import toml
|
||||||
|
import urllib.request
|
||||||
from dataclasses import dataclass
|
from dataclasses import dataclass
|
||||||
|
|
||||||
PACKAGER_TARGET_DIR = "target/packager"
|
PACKAGER_TARGET_DIR = "target/packager"
|
||||||
|
@ -75,6 +76,10 @@ def build_windows(package_info):
|
||||||
TARGET_DIR = os.path.join(PACKAGER_TARGET_DIR, "win")
|
TARGET_DIR = os.path.join(PACKAGER_TARGET_DIR, "win")
|
||||||
os.makedirs(TARGET_DIR, exist_ok=True)
|
os.makedirs(TARGET_DIR, exist_ok=True)
|
||||||
|
|
||||||
|
print("Downloading Visual C++ redistributable")
|
||||||
|
vc_redist_file = os.path.join(TARGET_DIR, "vc_redist.x64.exe")
|
||||||
|
urllib.request.urlretrieve("https://aka.ms/vs/16/release/vc_redist.x64.exe", vc_redist_file)
|
||||||
|
|
||||||
INSTALLER_NAME = f"espanso-win-installer"
|
INSTALLER_NAME = f"espanso-win-installer"
|
||||||
|
|
||||||
# Inno setup
|
# Inno setup
|
||||||
|
|
|
@ -170,7 +170,7 @@ var
|
||||||
begin
|
begin
|
||||||
taskname := ModPathName;
|
taskname := ModPathName;
|
||||||
if CurStep = ssPostInstall then
|
if CurStep = ssPostInstall then
|
||||||
if IsTaskSelected(taskname) then
|
if WizardIsTaskSelected(taskname) then
|
||||||
ModPath();
|
ModPath();
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
|
@ -37,11 +37,12 @@ Name: "english"; MessagesFile: "compiler:Default.isl"
|
||||||
[Files]
|
[Files]
|
||||||
Source: "{{{executable_path}}}"; DestDir: "{app}"; Flags: ignoreversion
|
Source: "{{{executable_path}}}"; DestDir: "{app}"; Flags: ignoreversion
|
||||||
Source: "{{{app_icon}}}"; DestDir: "{app}"; Flags: ignoreversion
|
Source: "{{{app_icon}}}"; DestDir: "{app}"; Flags: ignoreversion
|
||||||
|
Source: "vc_redist.x64.exe"; DestDir: "{tmp}"; Flags: deleteafterinstall
|
||||||
; NOTE: Don't use "Flags: ignoreversion" on any shared system files
|
; NOTE: Don't use "Flags: ignoreversion" on any shared system files
|
||||||
|
|
||||||
[Icons]
|
[Icons]
|
||||||
Name: "{autoprograms}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; IconFilename: "{app}\icon.ico"
|
Name: "{autoprograms}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Parameters: "start"; IconFilename: "{app}\icon.ico"
|
||||||
Name: "{userstartup}\espanso"; Filename: "{app}\espanso.exe"; Tasks:StartMenuEntry;
|
Name: "{userstartup}\espanso"; Filename: "{app}\espanso.exe"; Parameters: "start"; Tasks:StartMenuEntry;
|
||||||
|
|
||||||
[Tasks]
|
[Tasks]
|
||||||
Name: modifypath; Description: Add espanso to PATH ( recommended );
|
Name: modifypath; Description: Add espanso to PATH ( recommended );
|
||||||
|
@ -60,7 +61,10 @@ end;
|
||||||
#include "modpath.iss"
|
#include "modpath.iss"
|
||||||
|
|
||||||
[Run]
|
[Run]
|
||||||
Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent
|
Filename: {tmp}\vc_redist.x64.exe; \
|
||||||
|
Parameters: "/install /quiet"; \
|
||||||
|
StatusMsg: "Installing Visual C++ 2019 Redistributable";
|
||||||
|
Filename: "{app}\{#MyAppExeName}"; Parameters: "start"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent
|
||||||
|
|
||||||
[UninstallRun]
|
[UninstallRun]
|
||||||
Filename: "{cmd}"; Parameters: "/C ""taskkill /im espanso.exe /f /t"
|
Filename: "{cmd}"; Parameters: "/C ""taskkill /im espanso.exe /f /t"
|
|
@ -18,7 +18,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
use serde_yaml::{Mapping, Value};
|
use serde_yaml::{Mapping, Value};
|
||||||
use chrono::{DateTime, Utc};
|
use chrono::{DateTime, Local};
|
||||||
|
|
||||||
pub struct DateExtension {}
|
pub struct DateExtension {}
|
||||||
|
|
||||||
|
@ -34,7 +34,7 @@ impl super::Extension for DateExtension {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn calculate(&self, params: &Mapping) -> Option<String> {
|
fn calculate(&self, params: &Mapping) -> Option<String> {
|
||||||
let now: DateTime<Utc> = Utc::now();
|
let now: DateTime<Local> = Local::now();
|
||||||
|
|
||||||
let format = params.get(&Value::from("format"));
|
let format = params.get(&Value::from("format"));
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user