Add /F option for VentoyPlugson.exe to use the system default browser.

By default it will firstly try to use Google Chrome if possible.
This commit is contained in:
longpanda 2023-01-07 15:35:47 +08:00
parent 315cabb945
commit e24dacadcd
7 changed files with 28 additions and 13 deletions

View File

@ -12,6 +12,7 @@
char g_ventoy_dir[MAX_PATH]; char g_ventoy_dir[MAX_PATH];
static BOOL g_ChromeFirst = TRUE;
static BOOL g_running = FALSE; static BOOL g_running = FALSE;
static HWND g_refresh_button; static HWND g_refresh_button;
static HWND g_start_button; static HWND g_start_button;
@ -118,14 +119,17 @@ static void OpenURL(void)
sprintf_s(url, sizeof(url), "http://%s:%s/index.html", g_sysinfo.ip, g_sysinfo.port); sprintf_s(url, sizeof(url), "http://%s:%s/index.html", g_sysinfo.ip, g_sysinfo.port);
for (i = 0; Browsers[i] != NULL; i++) if (g_ChromeFirst)
{ {
if (ventoy_is_file_exist("%s", Browsers[i])) for (i = 0; Browsers[i] != NULL; i++)
{ {
ShellExecuteA(NULL, "open", Browsers[i], url, NULL, SW_SHOW); if (ventoy_is_file_exist("%s", Browsers[i]))
return; {
} ShellExecuteA(NULL, "open", Browsers[i], url, NULL, SW_SHOW);
} return;
}
}
}
ShellExecuteA(NULL, "open", url, NULL, NULL, SW_SHOW); ShellExecuteA(NULL, "open", url, NULL, NULL, SW_SHOW);
} }
@ -521,12 +525,22 @@ static void DllProtect(void)
int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, INT nCmdShow) int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, INT nCmdShow)
{ {
int i;
int rc; int rc;
HANDLE hMutex; HANDLE hMutex;
WCHAR CurDir[MAX_PATH]; WCHAR CurDir[MAX_PATH];
UNREFERENCED_PARAMETER(hPrevInstance); UNREFERENCED_PARAMETER(hPrevInstance);
for (i = 0; i < __argc; i++)
{
if (__argv[i] && _stricmp(__argv[i], "/F") == 0)
{
g_ChromeFirst = FALSE;
break;
}
}
DllProtect(); DllProtect();
if (GetUserDefaultUILanguage() == 0x0804) if (GetUserDefaultUILanguage() == 0x0804)

View File

@ -1 +1 @@
ar_ARbn_BNde_DEen_USfr_FRhi_HIhr_HRhu_HUid_IDja_JPka_GEko_KRpl_PLpt_PTru_RUsr_RSta_INtr_TRzh_CNzh_TW ar_ARbn_BNde_DEen_USes_ESfr_FRhi_HIhr_HRhu_HUid_IDja_JPka_GEko_KRpl_PLpt_PTru_RUsr_RSta_INtr_TRzh_CNzh_TW

View File

@ -777,10 +777,10 @@
<script src="/static/js/jQuery-2.1.4.min.js"></script> <script src="/static/js/jQuery-2.1.4.min.js"></script>
<!-- jquery validate --> <!-- jquery validate -->
<script src="/static/js/jquery.validate.min.js"></script> <script src="/static/js/jquery.validate.min.js"></script>
<script src="/static/js/jquery.validate.vtoymethods.js?v=109"></script> <script src="/static/js/jquery.validate.vtoymethods.js?v=142"></script>
<script src="/static/js/jquery.vtoy.alert.js?v=109"></script> <script src="/static/js/jquery.vtoy.alert.js?v=142"></script>
<script src="/static/js/vtoy.js?v=109"></script> <script src="/static/js/vtoy.js?v=142"></script>
<script src="/static/js/md5.min.js"></script> <script src="/static/js/md5.min.js"></script>
<!-- Bootstrap 3.3.5 --> <!-- Bootstrap 3.3.5 -->

View File

@ -1 +1 @@
ar_ARbn_BNde_DEen_USfr_FRhi_HIhr_HRhu_HUid_IDja_JPka_GEko_KRpl_PLpt_PTru_RUsr_RSta_INtr_TRzh_CNzh_TW ar_ARbn_BNde_DEen_USes_ESfr_FRhi_HIhr_HRhu_HUid_IDja_JPka_GEko_KRpl_PLpt_PTru_RUsr_RSta_INtr_TRzh_CNzh_TW

View File

@ -175,6 +175,7 @@
<td class="td_ctrl_col" id="td_title_setting">选项设置</td> <td class="td_ctrl_col" id="td_title_setting">选项设置</td>
<td> <td>
<select id="id_theme_sel_gfxmode" name="name_theme_sel_gfxmode" class="form-control"> <select id="id_theme_sel_gfxmode" name="name_theme_sel_gfxmode" class="form-control">
<option title="max">max</option>
<option title="1920x1080">1920x1080</option> <option title="1920x1080">1920x1080</option>
<option title="1680x1050">1680x1050</option> <option title="1680x1050">1680x1050</option>
<option title="1600x900">1600x900</option> <option title="1600x900">1600x900</option>