diff --git a/.gitignore b/.gitignore index 523ad3d..9d0b22e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,4 @@ /firefox-* -/librewolf-* /librewolf /mozilla-unified /tor-browser diff --git a/build.py b/build.py index 527444a..3fe33c0 100755 --- a/build.py +++ b/build.py @@ -466,7 +466,7 @@ def execute_lw_artifacts(): exec("cp -vr librewolf/* librewolf-{}/LibreWolf".format(tmp)) exec("rm -f librewolf-portable.exe") - exec("wget -q https://gitlab.com/stanzabird/librewolf-portable/uploads/46bf5b8bf2cfea61639b52d36d5852ea/librewolf-portable.exe") # v0.2.0 + exec("wget -q https://gitlab.com/librewolf-community/browser/windows/uploads/d8aeb768670911c7044b6c809782b3cc/librewolf-portable.exe") # v0.2.0 exec("mv librewolf-portable.exe librewolf-{}".format(tmp)) exec("rm -f {}".format(zipname)) diff --git a/librewolf-portable/.gitignore b/librewolf-portable/.gitignore new file mode 100644 index 0000000..6c1d6fd --- /dev/null +++ b/librewolf-portable/.gitignore @@ -0,0 +1,3 @@ +librewolf-portable.aps +.vs +x64 \ No newline at end of file diff --git a/librewolf-portable/README.md b/librewolf-portable/README.md new file mode 100644 index 0000000..74cfdfe --- /dev/null +++ b/librewolf-portable/README.md @@ -0,0 +1,3 @@ +# librewolf-portable + +Execute librewolf.exe -profile Profiles\Default \ No newline at end of file diff --git a/librewolf-portable/Resource.h b/librewolf-portable/Resource.h new file mode 100644 index 0000000..a50d042 --- /dev/null +++ b/librewolf-portable/Resource.h @@ -0,0 +1,30 @@ +//{{NO_DEPENDENCIES}} +// Microsoft Visual C++ generated include file. +// Used by librewolf-portable.rc + +#define IDS_APP_TITLE 103 + +#define IDR_MAINFRAME 128 +#define IDD_LIBREWOLFPORTABLE_DIALOG 102 +#define IDD_ABOUTBOX 103 +#define IDM_ABOUT 104 +#define IDM_EXIT 105 +#define IDI_LIBREWOLFPORTABLE 107 +#define IDI_SMALL 108 +#define IDC_LIBREWOLFPORTABLE 109 +#define IDC_MYICON 2 +#ifndef IDC_STATIC +#define IDC_STATIC -1 +#endif +// Next default values for new objects +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS + +#define _APS_NO_MFC 130 +#define _APS_NEXT_RESOURCE_VALUE 129 +#define _APS_NEXT_COMMAND_VALUE 32771 +#define _APS_NEXT_CONTROL_VALUE 1000 +#define _APS_NEXT_SYMED_VALUE 110 +#endif +#endif diff --git a/librewolf-portable/build.bat b/librewolf-portable/build.bat new file mode 100644 index 0000000..30e00ab --- /dev/null +++ b/librewolf-portable/build.bat @@ -0,0 +1 @@ +msbuild /t:Clean,Build /p:Configuration=Release \ No newline at end of file diff --git a/librewolf-portable/librewolf-portable.aps b/librewolf-portable/librewolf-portable.aps new file mode 100644 index 0000000..8faf56c Binary files /dev/null and b/librewolf-portable/librewolf-portable.aps differ diff --git a/librewolf-portable/librewolf-portable.cpp b/librewolf-portable/librewolf-portable.cpp new file mode 100644 index 0000000..57b3db7 --- /dev/null +++ b/librewolf-portable/librewolf-portable.cpp @@ -0,0 +1,64 @@ +// librewolf-portable.cpp : Run librewolf.exe with -profile parameter. +// + + +#define _CRT_SECURE_NO_WARNINGS +#include + + +int fileExists(TCHAR* file) +{ + WIN32_FIND_DATA FindFileData; + HANDLE handle = FindFirstFile(file, &FindFileData); + int found = handle != INVALID_HANDLE_VALUE; + if (found) + { + //FindClose(&handle); this will crash + FindClose(handle); + } + return found; +} + + +int APIENTRY wWinMain(_In_ HINSTANCE hInstance, + _In_opt_ HINSTANCE hPrevInstance, + _In_ LPWSTR lpCmdLine, + _In_ int nCmdShow) +{ + wchar_t path[_MAX_PATH + 1], dir[_MAX_PATH+1], exe[_MAX_PATH+1], cmdline[_MAX_PATH+1]; + + GetModuleFileName(NULL, path, _MAX_PATH); + *wcsrchr(path,L'\\') = L'\0'; + + wcscpy(dir, path); + wcscat(dir, L"\\Profiles\\Default"); + + wcscpy(exe, path); + wcscat(exe, L"\\librewolf.exe"); + if (!fileExists(exe)) { + wcscpy(exe, path); + wcscat(exe, L"\\LibreWolf\\librewolf.exe"); + if (!fileExists(exe)) { + MessageBox(NULL, L"Can\'t find librewolf.exe in . or LibreWolf", path, MB_OK); + return 1; + } + } + + wsprintf(cmdline, L"\"%s\" -profile \"%s\"", exe, dir); + + STARTUPINFOW siStartupInfo; + PROCESS_INFORMATION piProcessInfo; + memset(&siStartupInfo, 0, sizeof(siStartupInfo)); + memset(&piProcessInfo, 0, sizeof(piProcessInfo)); + siStartupInfo.cb = sizeof(siStartupInfo); + + if (!CreateProcess(exe, cmdline, NULL, NULL, FALSE, NORMAL_PRIORITY_CLASS, NULL, NULL, &siStartupInfo, &piProcessInfo)) + { + DWORD i = GetLastError(); + wsprintf(dir, L"CreateProcess() failed with error %i", i); + MessageBox(NULL, dir, L"librewolf-portable", MB_OK); + return 1; + } + + return 0; +} diff --git a/librewolf-portable/librewolf-portable.ico b/librewolf-portable/librewolf-portable.ico new file mode 100644 index 0000000..30a72f1 Binary files /dev/null and b/librewolf-portable/librewolf-portable.ico differ diff --git a/librewolf-portable/librewolf-portable.rc b/librewolf-portable/librewolf-portable.rc new file mode 100644 index 0000000..fac1fc7 Binary files /dev/null and b/librewolf-portable/librewolf-portable.rc differ diff --git a/librewolf-portable/librewolf-portable.sln b/librewolf-portable/librewolf-portable.sln new file mode 100644 index 0000000..f7a2ea8 --- /dev/null +++ b/librewolf-portable/librewolf-portable.sln @@ -0,0 +1,31 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.31424.327 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "librewolf-portable", "librewolf-portable.vcxproj", "{363A5584-2FEA-46A3-A52B-7254D932AABA}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {363A5584-2FEA-46A3-A52B-7254D932AABA}.Debug|x64.ActiveCfg = Debug|x64 + {363A5584-2FEA-46A3-A52B-7254D932AABA}.Debug|x64.Build.0 = Debug|x64 + {363A5584-2FEA-46A3-A52B-7254D932AABA}.Debug|x86.ActiveCfg = Debug|Win32 + {363A5584-2FEA-46A3-A52B-7254D932AABA}.Debug|x86.Build.0 = Debug|Win32 + {363A5584-2FEA-46A3-A52B-7254D932AABA}.Release|x64.ActiveCfg = Release|x64 + {363A5584-2FEA-46A3-A52B-7254D932AABA}.Release|x64.Build.0 = Release|x64 + {363A5584-2FEA-46A3-A52B-7254D932AABA}.Release|x86.ActiveCfg = Release|Win32 + {363A5584-2FEA-46A3-A52B-7254D932AABA}.Release|x86.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {968E3E1E-9A31-4937-A7E9-FF45C074E14E} + EndGlobalSection +EndGlobal diff --git a/librewolf-portable/librewolf-portable.vcxproj b/librewolf-portable/librewolf-portable.vcxproj new file mode 100644 index 0000000..5d5ee09 --- /dev/null +++ b/librewolf-portable/librewolf-portable.vcxproj @@ -0,0 +1,160 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + 16.0 + Win32Proj + {363a5584-2fea-46a3-a52b-7254d932aaba} + librewolfportable + 10.0 + + + + Application + true + v142 + Unicode + + + Application + false + v142 + true + Unicode + + + Application + true + v142 + Unicode + + + Application + false + v142 + true + Unicode + + + + + + + + + + + + + + + + + + + + + true + + + false + + + true + + + false + + + + Level3 + true + WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) + true + + + Windows + true + + + + + Level3 + true + true + true + WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) + true + + + Windows + true + true + true + + + + + Level3 + true + _DEBUG;_WINDOWS;%(PreprocessorDefinitions) + true + + + Windows + true + + + + + Level3 + true + true + true + NDEBUG;_WINDOWS;%(PreprocessorDefinitions) + true + + + Windows + true + true + true + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/librewolf-portable/librewolf-portable.vcxproj.filters b/librewolf-portable/librewolf-portable.vcxproj.filters new file mode 100644 index 0000000..b13c66c --- /dev/null +++ b/librewolf-portable/librewolf-portable.vcxproj.filters @@ -0,0 +1,49 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + + + Source Files + + + + + Resource Files + + + + + Resource Files + + + Resource Files + + + \ No newline at end of file diff --git a/librewolf-portable/librewolf-portable.vcxproj.user b/librewolf-portable/librewolf-portable.vcxproj.user new file mode 100644 index 0000000..88a5509 --- /dev/null +++ b/librewolf-portable/librewolf-portable.vcxproj.user @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/librewolf-portable/targetver.h b/librewolf-portable/targetver.h new file mode 100644 index 0000000..bf75e08 --- /dev/null +++ b/librewolf-portable/targetver.h @@ -0,0 +1,6 @@ +#pragma once + +// // Including SDKDDKVer.h defines the highest available Windows platform. +// If you wish to build your application for a previous Windows platform, include WinSDKVer.h and +// set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. +#include