-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add windows default install #605
Merged
Merged
Changes from 3 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
9952b04
Add install script
hulto 9c77057
Allow imix to service exes to be run as regular exes
hulto 233e5f2
Merge branch 'main' into add-windows-default-install
hulto 76b69c6
Resolve nits
hulto 81554d4
Merge branch 'main' into add-windows-default-install
hulto File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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 |
---|---|---|
|
@@ -3,14 +3,24 @@ | |
#[macro_use] | ||
extern crate windows_service; | ||
|
||
use imix::handle_main; | ||
use imix::{handle_main}; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remove the |
||
|
||
|
||
// ============= Standard =============== | ||
|
||
#[cfg(not(feature = "win_service"))] | ||
#[tokio::main(flavor = "multi_thread", worker_threads = 128)] | ||
async fn main() { | ||
#[cfg(debug_assertions)] | ||
imix::init_logging(); | ||
|
||
#[cfg(feature = "win_service")] | ||
match windows_service::service_dispatcher::start("imix", ffi_service_main) { | ||
Ok(_) => {}, | ||
Err(_err) => { | ||
#[cfg(debug_assertions)] | ||
log::error!("Failed to start service (running as exe?): {_err}"); | ||
}, | ||
} | ||
|
||
handle_main().await | ||
} | ||
|
@@ -24,19 +34,10 @@ compile_error!("Feature win_service is only available on windows targets"); | |
#[cfg(feature = "win_service")] | ||
define_windows_service!(ffi_service_main, service_main); | ||
|
||
#[cfg(feature = "win_service")] | ||
fn main() { | ||
use windows_service::service_dispatcher; | ||
service_dispatcher::start("imix", ffi_service_main).unwrap(); | ||
} | ||
|
||
#[cfg(feature = "win_service")] | ||
#[tokio::main(flavor = "multi_thread", worker_threads = 128)] | ||
async fn service_main(arguments: Vec<std::ffi::OsString>) { | ||
use imix::win_service::handle_service_main; | ||
|
||
handle_service_main(arguments); | ||
|
||
imix::win_service::handle_service_main(arguments); | ||
handle_main().await; | ||
} | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: combine these into one print statement
print("failed to create service:\n"+create_rest+"\n")