mirror of
https://github.com/yuzu-emu/liftinstall.git
synced 2024-11-25 09:35:47 +01:00
Use the correct icon for the application shortcuts
This commit is contained in:
parent
6af46ec703
commit
d2ad619d87
@ -43,7 +43,8 @@ extern "C" int saveShortcut(
|
|||||||
const wchar_t *description,
|
const wchar_t *description,
|
||||||
const wchar_t *path,
|
const wchar_t *path,
|
||||||
const wchar_t *args,
|
const wchar_t *args,
|
||||||
const wchar_t *workingDir)
|
const wchar_t *workingDir,
|
||||||
|
const wchar_t *exePath)
|
||||||
{
|
{
|
||||||
const char *errStr = NULL;
|
const char *errStr = NULL;
|
||||||
HRESULT h;
|
HRESULT h;
|
||||||
@ -82,6 +83,9 @@ extern "C" int saveShortcut(
|
|||||||
shellLink->SetDescription(description);
|
shellLink->SetDescription(description);
|
||||||
if (path != NULL)
|
if (path != NULL)
|
||||||
shellLink->SetPath(path);
|
shellLink->SetPath(path);
|
||||||
|
// default to using the first icon in the exe (usually correct)
|
||||||
|
if (exePath != NULL)
|
||||||
|
shellLink->SetIconLocation(exePath, 0);
|
||||||
if (args != NULL)
|
if (args != NULL)
|
||||||
shellLink->SetArguments(args);
|
shellLink->SetArguments(args);
|
||||||
if (workingDir != NULL)
|
if (workingDir != NULL)
|
||||||
|
@ -39,6 +39,7 @@ mod natives {
|
|||||||
path: *const winapi::ctypes::wchar_t,
|
path: *const winapi::ctypes::wchar_t,
|
||||||
args: *const winapi::ctypes::wchar_t,
|
args: *const winapi::ctypes::wchar_t,
|
||||||
workingDir: *const winapi::ctypes::wchar_t,
|
workingDir: *const winapi::ctypes::wchar_t,
|
||||||
|
exePath: *const winapi::ctypes::wchar_t,
|
||||||
) -> ::std::os::raw::c_int;
|
) -> ::std::os::raw::c_int;
|
||||||
|
|
||||||
pub fn isDarkThemeActive() -> ::std::os::raw::c_uint;
|
pub fn isDarkThemeActive() -> ::std::os::raw::c_uint;
|
||||||
@ -59,6 +60,7 @@ mod natives {
|
|||||||
target: &str,
|
target: &str,
|
||||||
args: &str,
|
args: &str,
|
||||||
working_dir: &str,
|
working_dir: &str,
|
||||||
|
exe_path: &str,
|
||||||
) -> Result<String, String> {
|
) -> Result<String, String> {
|
||||||
let source_file = format!(
|
let source_file = format!(
|
||||||
"{}\\Microsoft\\Windows\\Start Menu\\Programs\\{}.lnk",
|
"{}\\Microsoft\\Windows\\Start Menu\\Programs\\{}.lnk",
|
||||||
@ -78,6 +80,8 @@ mod natives {
|
|||||||
U16CString::from_str(args).log_expect("Error while converting to wchar_t");
|
U16CString::from_str(args).log_expect("Error while converting to wchar_t");
|
||||||
let native_working_dir =
|
let native_working_dir =
|
||||||
U16CString::from_str(working_dir).log_expect("Error while converting to wchar_t");
|
U16CString::from_str(working_dir).log_expect("Error while converting to wchar_t");
|
||||||
|
let native_exe_path =
|
||||||
|
U16CString::from_str(exe_path).log_expect("Error while converting to wchar_t");
|
||||||
|
|
||||||
let shortcutResult = unsafe {
|
let shortcutResult = unsafe {
|
||||||
saveShortcut(
|
saveShortcut(
|
||||||
@ -86,6 +90,7 @@ mod natives {
|
|||||||
native_target.as_ptr(),
|
native_target.as_ptr(),
|
||||||
native_args.as_ptr(),
|
native_args.as_ptr(),
|
||||||
native_working_dir.as_ptr(),
|
native_working_dir.as_ptr(),
|
||||||
|
native_exe_path.as_ptr(),
|
||||||
)
|
)
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -58,6 +58,7 @@ impl Task for InstallGlobalShortcutsTask {
|
|||||||
// TODO: Send by list
|
// TODO: Send by list
|
||||||
"",
|
"",
|
||||||
&starting_dir,
|
&starting_dir,
|
||||||
|
"",
|
||||||
)?;
|
)?;
|
||||||
|
|
||||||
if !shortcut_file.is_empty() {
|
if !shortcut_file.is_empty() {
|
||||||
|
@ -83,6 +83,7 @@ impl Task for InstallShortcutsTask {
|
|||||||
// TODO: Send by list
|
// TODO: Send by list
|
||||||
&format!("--launcher \"{}\"", exe_path),
|
&format!("--launcher \"{}\"", exe_path),
|
||||||
&starting_dir,
|
&starting_dir,
|
||||||
|
exe_path,
|
||||||
)?);
|
)?);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user