Skip to content

Commit 3bbdd66

Browse files
committed
[wue] cd to wrapper directory before looking for setup.dll
* Closes #2757.
1 parent c6a85b0 commit 3bbdd66

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

res/setup/setup.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,13 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine
9898
STARTUPINFOA si = { 0 };
9999
PROCESS_INFORMATION pi = { 0 };
100100
SECURITY_ATTRIBUTES sa = { sizeof(SECURITY_ATTRIBUTES), NULL, TRUE };
101+
WCHAR *wc, wPath[MAX_PATH] = { 0 };
102+
103+
// If invoked from a different directory, cd to where this executable resides
104+
if (GetModuleFileName(NULL, wPath, ARRAYSIZE(wPath)) != 0 && (wc = wcsrchr(wPath, L'\\')) != NULL) {
105+
*wc = L'\0';
106+
SetCurrentDirectory(wPath);
107+
}
101108

102109
// Make sure we have 'setup.dll' in the same directory
103110
dwAttrib = GetFileAttributesA("setup.dll");

src/rufus.rc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
3333
IDD_DIALOG DIALOGEX 12, 12, 232, 326
3434
STYLE DS_SETFONT | DS_MODALFRAME | DS_CENTER | WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU
3535
EXSTYLE WS_EX_ACCEPTFILES
36-
CAPTION "Rufus 4.10.2265"
36+
CAPTION "Rufus 4.10.2266"
3737
FONT 9, "Segoe UI Symbol", 400, 0, 0x0
3838
BEGIN
3939
LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP
@@ -407,8 +407,8 @@ END
407407
//
408408

409409
VS_VERSION_INFO VERSIONINFO
410-
FILEVERSION 4,10,2265,0
411-
PRODUCTVERSION 4,10,2265,0
410+
FILEVERSION 4,10,2266,0
411+
PRODUCTVERSION 4,10,2266,0
412412
FILEFLAGSMASK 0x3fL
413413
#ifdef _DEBUG
414414
FILEFLAGS 0x1L
@@ -426,13 +426,13 @@ BEGIN
426426
VALUE "Comments", "https://rufus.ie"
427427
VALUE "CompanyName", "Akeo Consulting"
428428
VALUE "FileDescription", "Rufus"
429-
VALUE "FileVersion", "4.10.2265"
429+
VALUE "FileVersion", "4.10.2266"
430430
VALUE "InternalName", "Rufus"
431431
VALUE "LegalCopyright", "� 2011-2025 Pete Batard (GPL v3)"
432432
VALUE "LegalTrademarks", "https://www.gnu.org/licenses/gpl-3.0.html"
433433
VALUE "OriginalFilename", "rufus-4.10.exe"
434434
VALUE "ProductName", "Rufus"
435-
VALUE "ProductVersion", "4.10.2265"
435+
VALUE "ProductVersion", "4.10.2266"
436436
END
437437
END
438438
BLOCK "VarFileInfo"

0 commit comments

Comments
 (0)