mirror of
https://github.com/feschber/lan-mouse.git
synced 2026-06-10 02:14:48 +03:00
Compare commits
8 Commits
attach-dia
...
windows-ms
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c01c6b3454 | ||
|
|
ac96faabec | ||
|
|
64d5058544 | ||
|
|
61259445c0 | ||
|
|
b9a4497fa4 | ||
|
|
2f824d8bd3 | ||
|
|
4397ce9f1c | ||
|
|
acb067bfde |
25
Cargo.lock
generated
25
Cargo.lock
generated
@@ -1087,30 +1087,6 @@ dependencies = [
|
||||
"system-deps",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "gdk4-wayland"
|
||||
version = "0.9.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "bd34518488cd624a85e75e82540bc24c72cfeb0aea6bad7faed683ca3977dba0"
|
||||
dependencies = [
|
||||
"gdk4",
|
||||
"gdk4-wayland-sys",
|
||||
"gio",
|
||||
"glib",
|
||||
"libc",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "gdk4-wayland-sys"
|
||||
version = "0.9.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "7c7a0f2332c531d62ee3f14f5e839ac1abac59e9b052adf1495124c00d89a34b"
|
||||
dependencies = [
|
||||
"glib-sys",
|
||||
"libc",
|
||||
"system-deps",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "generic-array"
|
||||
version = "0.14.7"
|
||||
@@ -1913,7 +1889,6 @@ name = "lan-mouse-gtk"
|
||||
version = "0.2.0"
|
||||
dependencies = [
|
||||
"async-channel",
|
||||
"gdk4-wayland",
|
||||
"glib-build-tools",
|
||||
"gtk4",
|
||||
"hostname",
|
||||
|
||||
@@ -2,7 +2,6 @@ use std::{
|
||||
collections::{HashMap, HashSet, VecDeque},
|
||||
fmt::Display,
|
||||
mem::swap,
|
||||
sync::{Arc, Mutex},
|
||||
task::{Poll, ready},
|
||||
};
|
||||
|
||||
@@ -130,24 +129,6 @@ pub struct InputCapture {
|
||||
pending: VecDeque<(CaptureHandle, CaptureEvent)>,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug)]
|
||||
pub enum WindowIdentifier {
|
||||
Wayland(String),
|
||||
X11(u32),
|
||||
}
|
||||
|
||||
#[cfg(all(unix, feature = "libei"))]
|
||||
impl Into<ashpd::WindowIdentifier> for WindowIdentifier {
|
||||
fn into(self) -> ashpd::WindowIdentifier {
|
||||
match self {
|
||||
WindowIdentifier::Wayland(handle) => {
|
||||
ashpd::WindowIdentifier::from_xdg_foreign_exported(handle)
|
||||
}
|
||||
WindowIdentifier::X11(_) => todo!(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl InputCapture {
|
||||
/// create a new client with the given id
|
||||
pub async fn create(&mut self, id: CaptureHandle, pos: Position) -> Result<(), CaptureError> {
|
||||
@@ -209,11 +190,8 @@ impl InputCapture {
|
||||
}
|
||||
|
||||
/// creates a new [`InputCapture`]
|
||||
pub async fn new(
|
||||
backend: Option<Backend>,
|
||||
window_identifier: Arc<Mutex<Option<WindowIdentifier>>>,
|
||||
) -> Result<Self, CaptureCreationError> {
|
||||
let capture = create(backend, window_identifier).await?;
|
||||
pub async fn new(backend: Option<Backend>) -> Result<Self, CaptureCreationError> {
|
||||
let capture = create(backend).await?;
|
||||
Ok(Self {
|
||||
capture,
|
||||
id_map: Default::default(),
|
||||
@@ -315,16 +293,13 @@ trait Capture: Stream<Item = Result<(Position, CaptureEvent), CaptureError>> + U
|
||||
|
||||
async fn create_backend(
|
||||
backend: Backend,
|
||||
window_identifier: Arc<Mutex<Option<WindowIdentifier>>>,
|
||||
) -> Result<
|
||||
Box<dyn Capture<Item = Result<(Position, CaptureEvent), CaptureError>>>,
|
||||
CaptureCreationError,
|
||||
> {
|
||||
match backend {
|
||||
#[cfg(all(unix, feature = "libei", not(target_os = "macos")))]
|
||||
Backend::InputCapturePortal => Ok(Box::new(
|
||||
libei::LibeiInputCapture::new(window_identifier).await?,
|
||||
)),
|
||||
Backend::InputCapturePortal => Ok(Box::new(libei::LibeiInputCapture::new().await?)),
|
||||
#[cfg(all(unix, feature = "layer_shell", not(target_os = "macos")))]
|
||||
Backend::LayerShell => Ok(Box::new(layer_shell::LayerShellInputCapture::new()?)),
|
||||
#[cfg(all(unix, feature = "x11", not(target_os = "macos")))]
|
||||
@@ -339,13 +314,12 @@ async fn create_backend(
|
||||
|
||||
async fn create(
|
||||
backend: Option<Backend>,
|
||||
window_identifier: Arc<Mutex<Option<WindowIdentifier>>>,
|
||||
) -> Result<
|
||||
Box<dyn Capture<Item = Result<(Position, CaptureEvent), CaptureError>>>,
|
||||
CaptureCreationError,
|
||||
> {
|
||||
if let Some(backend) = backend {
|
||||
let b = create_backend(backend, window_identifier).await;
|
||||
let b = create_backend(backend).await;
|
||||
if b.is_ok() {
|
||||
log::info!("using capture backend: {backend}");
|
||||
}
|
||||
@@ -364,7 +338,7 @@ async fn create(
|
||||
#[cfg(target_os = "macos")]
|
||||
Backend::MacOs,
|
||||
] {
|
||||
match create_backend(backend, window_identifier.clone()).await {
|
||||
match create_backend(backend).await {
|
||||
Ok(b) => {
|
||||
log::info!("using capture backend: {backend}");
|
||||
return Ok(b);
|
||||
|
||||
@@ -23,7 +23,7 @@ use std::{
|
||||
os::unix::net::UnixStream,
|
||||
pin::Pin,
|
||||
rc::Rc,
|
||||
sync::{Arc, Mutex},
|
||||
sync::Arc,
|
||||
task::{Context, Poll},
|
||||
};
|
||||
use tokio::{
|
||||
@@ -39,7 +39,7 @@ use futures_core::Stream;
|
||||
|
||||
use input_event::Event;
|
||||
|
||||
use crate::{CaptureEvent, WindowIdentifier};
|
||||
use crate::CaptureEvent;
|
||||
|
||||
use super::{
|
||||
Capture as LanMouseInputCapture, Position,
|
||||
@@ -161,17 +161,13 @@ async fn update_barriers(
|
||||
|
||||
async fn create_session(
|
||||
input_capture: &InputCapture,
|
||||
window_identifier: Arc<Mutex<Option<WindowIdentifier>>>,
|
||||
) -> std::result::Result<(Session<InputCapture>, BitFlags<Capabilities>), ashpd::Error> {
|
||||
log::debug!("creating input capture session: {window_identifier:?}");
|
||||
let window_identifier = window_identifier.lock().unwrap().clone();
|
||||
log::debug!("creating input capture session");
|
||||
let create_session_options = CreateSessionOptions::default().set_capabilities(
|
||||
Capabilities::Keyboard | Capabilities::Pointer | Capabilities::Touchscreen,
|
||||
);
|
||||
let ashpd_window_identifier: Option<ashpd::WindowIdentifier> =
|
||||
window_identifier.map(|i| i.into());
|
||||
input_capture
|
||||
.create_session(ashpd_window_identifier.as_ref(), create_session_options)
|
||||
.create_session(None, create_session_options)
|
||||
.await
|
||||
}
|
||||
|
||||
@@ -216,15 +212,10 @@ async fn libei_event_handler(
|
||||
}
|
||||
|
||||
impl LibeiInputCapture {
|
||||
/// creates a new libei input capture
|
||||
/// `window_id` is a window identifier for user prompts
|
||||
pub async fn new(
|
||||
window_identifier: Arc<Mutex<Option<WindowIdentifier>>>,
|
||||
) -> std::result::Result<Self, LibeiCaptureCreationError> {
|
||||
pub async fn new() -> std::result::Result<Self, LibeiCaptureCreationError> {
|
||||
let input_capture = Box::pin(InputCapture::new().await?);
|
||||
let input_capture_ptr = input_capture.as_ref().get_ref() as *const InputCapture;
|
||||
let first_session =
|
||||
Some(create_session(unsafe { &*input_capture_ptr }, window_identifier.clone()).await?);
|
||||
let first_session = Some(create_session(unsafe { &*input_capture_ptr }).await?);
|
||||
|
||||
let (event_tx, event_rx) = mpsc::channel(1);
|
||||
let (notify_capture, notify_rx) = mpsc::channel(1);
|
||||
@@ -239,7 +230,6 @@ impl LibeiInputCapture {
|
||||
first_session,
|
||||
event_tx,
|
||||
cancellation_token.clone(),
|
||||
window_identifier,
|
||||
);
|
||||
let capture_task = tokio::task::spawn_local(capture);
|
||||
|
||||
@@ -264,7 +254,6 @@ async fn do_capture(
|
||||
session: Option<(Session<InputCapture>, BitFlags<Capabilities>)>,
|
||||
event_tx: Sender<(Position, CaptureEvent)>,
|
||||
cancellation_token: CancellationToken,
|
||||
window_identifier: Arc<Mutex<Option<WindowIdentifier>>>,
|
||||
) -> Result<(), CaptureError> {
|
||||
let mut session = session.map(|s| s.0);
|
||||
|
||||
@@ -310,11 +299,7 @@ async fn do_capture(
|
||||
// create session
|
||||
let mut session = match session.take() {
|
||||
Some(s) => s,
|
||||
None => {
|
||||
create_session(input_capture, window_identifier.clone())
|
||||
.await?
|
||||
.0
|
||||
}
|
||||
None => create_session(input_capture).await?.0,
|
||||
};
|
||||
|
||||
let capture_session = do_capture_session(
|
||||
|
||||
@@ -15,13 +15,5 @@ log = "0.4.20"
|
||||
lan-mouse-ipc = { path = "../lan-mouse-ipc", version = "0.2.0" }
|
||||
thiserror = "2.0.0"
|
||||
|
||||
[target.'cfg(all(unix, not(target_os="macos")))'.dependencies]
|
||||
gdk4_wayland = { package = "gdk4-wayland", version="0.9.6", optional=true }
|
||||
|
||||
[build-dependencies]
|
||||
glib-build-tools = { version = "0.20.0" }
|
||||
|
||||
|
||||
[features]
|
||||
default = ["wayland_window_identifier"]
|
||||
wayland_window_identifier = ["dep:gdk4_wayland"]
|
||||
|
||||
@@ -14,7 +14,7 @@ use std::{env, process, str};
|
||||
|
||||
use window::Window;
|
||||
|
||||
use lan_mouse_ipc::{FrontendEvent, FrontendRequest, WindowIdentifier};
|
||||
use lan_mouse_ipc::FrontendEvent;
|
||||
|
||||
use adw::Application;
|
||||
use gtk::{IconTheme, gdk::Display, glib::clone, prelude::*};
|
||||
@@ -23,9 +23,6 @@ use gtk::{gio, glib, prelude::ApplicationExt};
|
||||
use self::client_object::ClientObject;
|
||||
use self::key_object::KeyObject;
|
||||
|
||||
#[cfg(all(unix, feature = "wayland_window_identifier", not(target_os = "macos")))]
|
||||
use gdk4_wayland::WaylandToplevel;
|
||||
|
||||
use thiserror::Error;
|
||||
|
||||
#[derive(Error, Debug)]
|
||||
@@ -230,28 +227,6 @@ fn build_ui(app: &Application) {
|
||||
});
|
||||
}
|
||||
|
||||
// export TopLevel handle and send it to the service so that it can put the InpuCapture / RemoteDesktop
|
||||
// windows on top of it using xdg-foreign.
|
||||
#[cfg(all(unix, feature = "wayland_window_identifier", not(target_os = "macos")))]
|
||||
window.connect_show(|window| {
|
||||
// needs the surface so we have to present first!
|
||||
if let Some(surface) = window.surface() {
|
||||
if surface.display().backend().is_wayland() {
|
||||
// let surface = surface.downcast::<WaylandSurface>();
|
||||
let toplevel = surface.downcast::<WaylandToplevel>().expect("xdg-toplevel");
|
||||
let window = window.clone();
|
||||
toplevel.export_handle(move |_toplevel, handle| {
|
||||
if let Ok(handle) = handle {
|
||||
let handle = handle.to_string();
|
||||
window.request(FrontendRequest::WindowIdentifier(
|
||||
WindowIdentifier::Wayland(handle),
|
||||
));
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
glib::spawn_future_local(clone!(
|
||||
#[weak]
|
||||
window,
|
||||
|
||||
@@ -433,7 +433,7 @@ impl Window {
|
||||
self.request(FrontendRequest::RemoveAuthorizedKey(fp));
|
||||
}
|
||||
|
||||
pub(crate) fn request(&self, request: FrontendRequest) {
|
||||
fn request(&self, request: FrontendRequest) {
|
||||
let mut requester = self.imp().frontend_request_writer.borrow_mut();
|
||||
let requester = requester.as_mut().unwrap();
|
||||
if let Err(e) = requester.request(request) {
|
||||
|
||||
@@ -255,14 +255,6 @@ pub enum FrontendRequest {
|
||||
UpdateEnterHook(u64, Option<String>),
|
||||
/// save config file
|
||||
SaveConfiguration,
|
||||
/// window identifier used to present input-capture / remote-desktop prompts
|
||||
WindowIdentifier(WindowIdentifier),
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
|
||||
pub enum WindowIdentifier {
|
||||
Wayland(String),
|
||||
X11(u32),
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy, PartialEq, Eq, Debug, Default, Serialize, Deserialize)]
|
||||
|
||||
@@ -1,14 +1,12 @@
|
||||
use std::{
|
||||
cell::{Cell, RefCell},
|
||||
rc::Rc,
|
||||
sync::{Arc, Mutex},
|
||||
time::{Duration, Instant},
|
||||
};
|
||||
|
||||
use futures::StreamExt;
|
||||
use input_capture::{
|
||||
CaptureError, CaptureEvent, CaptureHandle, InputCapture, InputCaptureError, Position,
|
||||
WindowIdentifier,
|
||||
};
|
||||
use input_event::{Event, KeyboardEvent, scancode};
|
||||
use lan_mouse_proto::ProtoEvent;
|
||||
@@ -70,7 +68,6 @@ impl Capture {
|
||||
backend: Option<input_capture::Backend>,
|
||||
conn: LanMouseConnection,
|
||||
release_bind: Vec<scancode::Linux>,
|
||||
window_identifier: Arc<Mutex<Option<WindowIdentifier>>>,
|
||||
) -> Self {
|
||||
let (request_tx, request_rx) = channel();
|
||||
let (event_tx, event_rx) = channel();
|
||||
@@ -85,7 +82,6 @@ impl Capture {
|
||||
request_rx,
|
||||
release_bind: Rc::new(RefCell::new(release_bind)),
|
||||
state: Default::default(),
|
||||
window_identifier,
|
||||
};
|
||||
let task = spawn_local(capture_task.run());
|
||||
Self {
|
||||
@@ -170,7 +166,6 @@ struct CaptureTask {
|
||||
release_bind: Rc<RefCell<Vec<scancode::Linux>>>,
|
||||
request_rx: Receiver<CaptureRequest>,
|
||||
state: State,
|
||||
window_identifier: Arc<Mutex<Option<WindowIdentifier>>>,
|
||||
}
|
||||
|
||||
impl CaptureTask {
|
||||
@@ -205,7 +200,6 @@ impl CaptureTask {
|
||||
}
|
||||
|
||||
async fn run(mut self) {
|
||||
tokio::time::sleep(Duration::from_secs(1)).await;
|
||||
loop {
|
||||
if let Err(e) = self.do_capture().await {
|
||||
log::warn!("input capture exited: {e}");
|
||||
@@ -230,7 +224,7 @@ impl CaptureTask {
|
||||
async fn do_capture(&mut self) -> Result<(), InputCaptureError> {
|
||||
/* allow cancelling capture request */
|
||||
let mut capture = tokio::select! {
|
||||
r = InputCapture::new(self.backend, self.window_identifier.clone()) => r?,
|
||||
r = InputCapture::new(self.backend) => r?,
|
||||
_ = self.cancellation_token.cancelled() => return Ok(()),
|
||||
};
|
||||
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
use std::sync::{Arc, Mutex};
|
||||
|
||||
use crate::config::Config;
|
||||
use clap::Args;
|
||||
use futures::StreamExt;
|
||||
@@ -14,7 +12,7 @@ pub async fn run(config: Config, _args: TestCaptureArgs) -> Result<(), InputCapt
|
||||
log::info!("creating input capture");
|
||||
let backend = config.capture_backend().map(|b| b.into());
|
||||
loop {
|
||||
let mut input_capture = InputCapture::new(backend, Arc::new(Mutex::new(None))).await?;
|
||||
let mut input_capture = InputCapture::new(backend).await?;
|
||||
log::info!("creating clients");
|
||||
input_capture.create(0, Position::Left).await?;
|
||||
input_capture.create(4, Position::Left).await?;
|
||||
|
||||
@@ -19,7 +19,7 @@ use std::{
|
||||
collections::{HashMap, HashSet, VecDeque},
|
||||
io,
|
||||
net::{IpAddr, SocketAddr},
|
||||
sync::{Arc, Mutex, RwLock},
|
||||
sync::{Arc, RwLock},
|
||||
};
|
||||
use thiserror::Error;
|
||||
use tokio::{process::Command, signal, sync::Notify};
|
||||
@@ -70,7 +70,6 @@ pub struct Service {
|
||||
/// map from capture handle to connection info
|
||||
incoming_conn_info: HashMap<ClientHandle, Incoming>,
|
||||
next_trigger_handle: u64,
|
||||
window_identifier: Arc<Mutex<Option<input_capture::WindowIdentifier>>>,
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
@@ -102,13 +101,7 @@ impl Service {
|
||||
|
||||
// input capture + emulation
|
||||
let capture_backend = config.capture_backend().map(|b| b.into());
|
||||
let window_identifier = Arc::new(Mutex::new(None));
|
||||
let capture = Capture::new(
|
||||
capture_backend,
|
||||
conn,
|
||||
config.release_bind(),
|
||||
window_identifier.clone(),
|
||||
);
|
||||
let capture = Capture::new(capture_backend, conn, config.release_bind());
|
||||
let emulation_backend = config.emulation_backend().map(|b| b.into());
|
||||
let emulation = Emulation::new(emulation_backend, listener);
|
||||
|
||||
@@ -133,7 +126,6 @@ impl Service {
|
||||
incoming_conn_info: Default::default(),
|
||||
incoming_conns: Default::default(),
|
||||
next_trigger_handle: 0,
|
||||
window_identifier,
|
||||
};
|
||||
Ok(service)
|
||||
}
|
||||
@@ -226,20 +218,6 @@ impl Service {
|
||||
self.update_enter_hook(handle, enter_hook)
|
||||
}
|
||||
FrontendRequest::SaveConfiguration => self.save_config(),
|
||||
FrontendRequest::WindowIdentifier(handle) => {
|
||||
log::info!("xdg-foreign handle: {handle:?}");
|
||||
self.window_identifier
|
||||
.lock()
|
||||
.unwrap()
|
||||
.replace(match handle {
|
||||
lan_mouse_ipc::WindowIdentifier::Wayland(handle) => {
|
||||
input_capture::WindowIdentifier::Wayland(handle)
|
||||
}
|
||||
lan_mouse_ipc::WindowIdentifier::X11(xid) => {
|
||||
input_capture::WindowIdentifier::X11(xid)
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
3
wix/bundle/.gitignore
vendored
Normal file
3
wix/bundle/.gitignore
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
/bin
|
||||
/obj
|
||||
icon.ico
|
||||
16
wix/bundle/Bundle.wixproj
Normal file
16
wix/bundle/Bundle.wixproj
Normal file
@@ -0,0 +1,16 @@
|
||||
<Project Sdk="WixToolset.Sdk/5.0.0">
|
||||
<PropertyGroup>
|
||||
<OutputType>Bundle</OutputType>
|
||||
<TargetExt>.exe</TargetExt>
|
||||
<Platforms>x64</Platforms>
|
||||
<InstallerPlatform>x64</InstallerPlatform>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="WixToolset.Heat">
|
||||
<Version>5.0.2</Version>
|
||||
</PackageReference>
|
||||
<PackageReference Include="WixToolset.Bal.wixext">
|
||||
<Version>5.0.2</Version>
|
||||
</PackageReference>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
42
wix/bundle/Bundle.wxs
Normal file
42
wix/bundle/Bundle.wxs
Normal file
@@ -0,0 +1,42 @@
|
||||
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs"
|
||||
xmlns:bal="http://wixtoolset.org/schemas/v4/wxs/bal">
|
||||
|
||||
<Bundle
|
||||
Name="Lan Mouse"
|
||||
Version="0.10.0"
|
||||
UpgradeCode="{39A9744D-9D6E-4CD3-A84F-9E034786A7B1}"
|
||||
Compressed="no"
|
||||
SplashScreenSourceFile="icon.ico">
|
||||
|
||||
<BootstrapperApplication>
|
||||
<bal:WixStandardBootstrapperApplication
|
||||
LicenseUrl=""
|
||||
Theme="hyperlinkLicense" />
|
||||
</BootstrapperApplication>
|
||||
|
||||
<Chain>
|
||||
<!-- Visual C++ 2015-2022 Redistributable (x64) - 14.40.33810 -->
|
||||
<ExePackage
|
||||
Id="VC_REDIST_X64"
|
||||
DisplayName="Microsoft Visual C++ 2015-2022 Redistributable (x64) - 14.40.33810"
|
||||
PerMachine="yes"
|
||||
Permanent="yes"
|
||||
Protocol="burn"
|
||||
InstallCondition="VersionNT64 AND (ARCH_NAME = "AMD64")"
|
||||
DetectCondition="(VCRUNTIME_X64_VER >= VCRUNTIME_VER) AND VersionNT64 AND (ARCH_NAME = "AMD64")"
|
||||
InstallArguments="/install /quiet /norestart"
|
||||
RepairArguments="/repair /quiet /norestart"
|
||||
UninstallArguments="/uninstall /quiet /norestart">
|
||||
<ExePackagePayload
|
||||
Name="VC_redist.x64.exe"
|
||||
ProductName="Microsoft Visual C++ 2015-2022 Redistributable (x64) - 14.40.33810"
|
||||
Description="Microsoft Visual C++ 2015-2022 Redistributable (x64) - 14.40.33810"
|
||||
Hash="5935B69F5138AC3FBC33813C74DA853269BA079F910936AEFA95E230C6092B92F6225BFFB594E5DD35FF29BF260E4B35F91ADEDE90FDF5F062030D8666FD0104"
|
||||
Size="25397512"
|
||||
Version="14.40.33810.0"
|
||||
DownloadUrl="https://download.visualstudio.microsoft.com/download/pr/1754ea58-11a6-44ab-a262-696e194ce543/3642E3F95D50CC193E4B5A0B0FFBF7FE2C08801517758B4C8AEB7105A091208A/VC_redist.x64.exe" />
|
||||
</ExePackage>
|
||||
<MsiPackage SourceFile="..\lan-mouse\bin\Debug\en-US\LanMouse.msi" Compressed="yes"/>
|
||||
</Chain>
|
||||
</Bundle>
|
||||
</Wix>
|
||||
3
wix/lan-mouse/.gitignore
vendored
Normal file
3
wix/lan-mouse/.gitignore
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
/bin
|
||||
/obj
|
||||
icon.ico
|
||||
13
wix/lan-mouse/Folders.wxs
Normal file
13
wix/lan-mouse/Folders.wxs
Normal file
@@ -0,0 +1,13 @@
|
||||
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs">
|
||||
<Fragment>
|
||||
<StandardDirectory Id="ProgramFiles64Folder">
|
||||
<Directory Id="INSTALLFOLDER" Name="!(bind.Property.Manufacturer) !(bind.Property.ProductName)">
|
||||
<Directory Id="SHARE" Name="share"/>
|
||||
<Directory Id="LIB" Name="lib"/>
|
||||
</Directory>
|
||||
</StandardDirectory>
|
||||
<StandardDirectory Id="ProgramMenuFolder">
|
||||
<Directory Id="ApplicationProgramsFolder" Name="!(bind.Property.ProductName)"/>
|
||||
</StandardDirectory>
|
||||
</Fragment>
|
||||
</Wix>
|
||||
34
wix/lan-mouse/LanMouse.wixproj
Normal file
34
wix/lan-mouse/LanMouse.wixproj
Normal file
@@ -0,0 +1,34 @@
|
||||
<Project Sdk="WixToolset.Sdk/5.0.2">
|
||||
<PropertyGroup>
|
||||
<InstallerPlatform>x64</InstallerPlatform>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="WixToolset.Heat">
|
||||
<Version>5.0.2</Version>
|
||||
</PackageReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<HarvestDirectory Include="C:\gtk-build\gtk\x64\release\bin">
|
||||
<ComponentGroupName>GTKBIN</ComponentGroupName>
|
||||
<DirectoryRefId>INSTALLFOLDER</DirectoryRefId>
|
||||
<SuppressRegistry>true</SuppressRegistry>
|
||||
</HarvestDirectory>
|
||||
<BindPath Include="C:\gtk-build\gtk\x64\release\bin" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<HarvestDirectory Include="C:\gtk-build\gtk\x64\release\share\icons">
|
||||
<ComponentGroupName>GTKICONS</ComponentGroupName>
|
||||
<DirectoryRefId>SHARE</DirectoryRefId>
|
||||
<SuppressRegistry>true</SuppressRegistry>
|
||||
</HarvestDirectory>
|
||||
<BindPath Include="C:\gtk-build\gtk\x64\release\share\icons" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<HarvestDirectory Include="C:\gtk-build\gtk\x64\release\lib\gdk-pixbuf-2.0">
|
||||
<ComponentGroupName>GTKLIBS</ComponentGroupName>
|
||||
<DirectoryRefId>LIB</DirectoryRefId>
|
||||
<SuppressRegistry>true</SuppressRegistry>
|
||||
</HarvestDirectory>
|
||||
<BindPath Include="C:\gtk-build\gtk\x64\release\lib\gdk-pixbuf-2.0" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
32
wix/lan-mouse/LanMouseComponents.wxs
Normal file
32
wix/lan-mouse/LanMouseComponents.wxs
Normal file
@@ -0,0 +1,32 @@
|
||||
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs">
|
||||
<Fragment>
|
||||
<ComponentGroup Id="LanMouseComponents" Directory="INSTALLFOLDER" Subdirectory="bin">
|
||||
<Component Guid="{ECB52D3E-28AD-4BEC-B9DF-E01CCAB356BE}">
|
||||
<!-- the main binary -->
|
||||
<File Source="..\..\target\release\lan-mouse.exe"/>
|
||||
|
||||
<!-- visual c runtime dll -->
|
||||
<!--<File Source="C:\windows\system32\VCRUNTIME140.dll"/>-->
|
||||
<!--<File Source="C:\windows\system32\VCRUNTIME140_1.dll"/>-->
|
||||
</Component>
|
||||
<!-- start menu entry-->
|
||||
<Component Id="ApplicationShortcut" Directory="ApplicationProgramsFolder">
|
||||
<Shortcut Id="ApplicationStartMenuShortcut"
|
||||
Name="!(bind.Property.ProductName)"
|
||||
Description ="Mouse and Keyboard sharing Software"
|
||||
Target="[INSTALLFOLDER]bin\lan-mouse.exe"
|
||||
WorkingDirectory="INSTALLFOLDER">
|
||||
<Icon Id="LanMouse" SourceFile=".\icon.ico"/>
|
||||
</Shortcut>
|
||||
<RemoveFolder Id="ApplicationProgramsFolder" On="uninstall"/>
|
||||
<RegistryValue
|
||||
Root="HKCU"
|
||||
Key="Software\Feschber\LanMouse"
|
||||
Name="installed"
|
||||
Type="integer"
|
||||
Value="1"
|
||||
KeyPath="yes"/>
|
||||
</Component>
|
||||
</ComponentGroup>
|
||||
</Fragment>
|
||||
</Wix>
|
||||
8
wix/lan-mouse/Package.en-us.wxl
Normal file
8
wix/lan-mouse/Package.en-us.wxl
Normal file
@@ -0,0 +1,8 @@
|
||||
<!--
|
||||
This file contains the declaration of all the localizable strings.
|
||||
-->
|
||||
<WixLocalization xmlns="http://wixtoolset.org/schemas/v4/wxl" Culture="en-US">
|
||||
|
||||
<String Id="DowngradeError" Value="A newer version of [ProductName] is already installed." />
|
||||
|
||||
</WixLocalization>
|
||||
16
wix/lan-mouse/Package.wxs
Normal file
16
wix/lan-mouse/Package.wxs
Normal file
@@ -0,0 +1,16 @@
|
||||
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs">
|
||||
<Package Name="Lan Mouse"
|
||||
Manufacturer="Ferdinand Schober"
|
||||
Version="0.10.0.0"
|
||||
UpgradeCode="{a330cd60-4c35-4a54-8bb6-75b3049b46c6}">
|
||||
<MajorUpgrade DowngradeErrorMessage="!(loc.DowngradeError)" />
|
||||
|
||||
<MediaTemplate EmbedCab="yes"/>
|
||||
<Feature Id="Main">
|
||||
<ComponentGroupRef Id="GTKBIN"/>
|
||||
<ComponentGroupRef Id="GTKICONS"/>
|
||||
<ComponentGroupRef Id="GTKLIBS"/>
|
||||
<ComponentGroupRef Id="LanMouseComponents"/>
|
||||
</Feature>
|
||||
</Package>
|
||||
</Wix>
|
||||
2
wix/lan-mouse/build.ps1
Normal file
2
wix/lan-mouse/build.ps1
Normal file
@@ -0,0 +1,2 @@
|
||||
magick -background none -density 384 ..\lan-mouse-gtk\resources\de.feschber.LanMouse.svg -trim -define icon:auto-resize icon.ico
|
||||
dotnet build
|
||||
Reference in New Issue
Block a user