Skip to content
This repository was archived by the owner on Sep 6, 2023. It is now read-only.

Commit 2a739db

Browse files
github actions
1 parent f1816a1 commit 2a739db

File tree

5 files changed

+16
-41
lines changed

5 files changed

+16
-41
lines changed

.github/workflows/windows_build.yml renamed to .github/workflows/publish_windows_release.yml

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,11 @@
1-
# This is a basic workflow to help you get started with Actions
2-
3-
name: windows_build
1+
name: PublishWindowsRelease
42

53
env:
6-
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
74
BUILD_TYPE: Release
85

9-
# Controls when the workflow will run
106
on:
11-
# Triggers the workflow on push or pull request events but only for the main branch
127
workflow_dispatch:
138

14-
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
159
jobs:
1610
build:
1711
runs-on: windows-2019
@@ -39,9 +33,6 @@ jobs:
3933
- name: Configure CMake
4034
shell: bash
4135
working-directory: ${{runner.workspace}}/build
42-
# Note the current convention is to use the -S and -B options here to specify source
43-
# and build directories, but this is only available with CMake 3.13 and higher.
44-
# The CMake binaries on the Github Actions machines are (as of this writing) 3.12
4536
run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE -G "Visual Studio 16 2019" -A x64
4637

4738
- name: Build OFS
@@ -53,28 +44,12 @@ jobs:
5344
5445
- name: FFMPEG & Zip
5546
run: |
56-
choco install -y -r --no-progress 7zip
5747
choco install -y -r --no-progress InnoSetup
58-
powershell Invoke-WebRequest -Uri "https://www.gyan.dev/ffmpeg/builds/ffmpeg-git-essentials.7z" -OutFile "${{runner.workspace}}\ffmpeg.7z"
59-
60-
mkdir "${{runner.workspace}}\ffmpeg"
61-
7z e "${{runner.workspace}}\ffmpeg.7z" -o${{runner.workspace}}\ffmpeg
62-
cp "${{runner.workspace}}\ffmpeg\ffmpeg.exe" "${{runner.workspace}}\OFS\bin\Release\ffmpeg.exe"
6348
powershell Compress-Archive "${{runner.workspace}}\OFS\bin\Release" "${{runner.workspace}}\OFS-64x_${{github.sha}}.zip"
6449
65-
# - uses: actions/upload-artifact@v2
66-
# with:
67-
# name: OFS-64x_${{github.sha}}.zip
68-
# path: ${{runner.workspace}}\OFS-64x_${{github.sha}}.zip
69-
7050
- name: Installer
7151
run: iscc "${{runner.workspace}}\OFS\ofs-installer.iss"
7252

73-
# - uses: actions/upload-artifact@v2
74-
# with:
75-
# name: OFS-64x_${{github.sha}}.exe
76-
# path: ${{runner.workspace}}\OFS\installer\ofs-installer.exe
77-
7853
- name: Upload Release Zip
7954
id: upload-release-zip
8055
uses: actions/upload-release-asset@v1

OFS-lib/OFS_Util.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -464,13 +464,12 @@ bool Util::SavePNG(const std::string& path, void* buffer, int32_t width, int32_t
464464

465465
std::filesystem::path Util::FfmpegPath() noexcept
466466
{
467-
auto base_path = Util::Basepath();
468467
#if WIN32
469-
auto ffmpeg_path = base_path / "ffmpeg.exe";
468+
return Util::PathFromString(Util::Prefpath("ffmpeg.exe"));
470469
#else
471-
auto ffmpeg_path = std::filesystem::path("ffmpeg");
470+
auto ffmpegPath = std::filesystem::path("ffmpeg");
471+
return ffmpegPath;
472472
#endif
473-
return ffmpeg_path;
474473
}
475474

476475
uint32_t Util::Hash(const char* data, size_t size, int32_t seed) noexcept

lib/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,4 +309,5 @@ file (GLOB ImGuizmo_SOURCES ImGuizmo/*.cpp)
309309
file (GLOB ImGuizmo_HEADERS ImGuizmo/*.h)
310310
add_library(ImGuizmo STATIC ${ImGuizmo_SOURCES} ${ImGuizmo_HEADERS})
311311
target_include_directories(ImGuizmo PUBLIC "ImGuizmo/")
312-
target_link_libraries(ImGuizmo PUBLIC imgui)
312+
target_link_libraries(ImGuizmo PUBLIC imgui)
313+
target_compile_features(ImGuizmo PRIVATE cxx_std_17)

ofs-installer.iss

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ OutputDir=.\installer
1818
[Files]
1919
Source: "bin\{#Configuration}\OpenFunscripter.exe"; DestDir: "{app}"
2020
Source: "bin\{#Configuration}\*.dll"; DestDir: "{app}"
21-
Source: "bin\{#Configuration}\ffmpeg.exe"; DestDir: "{app}"
2221
Source: "data\*"; Flags: recursesubdirs; DestDir: "{app}\data"
2322

2423
[Icons]

src/UI/OFS_DownloadFfmpeg.cpp

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757

5858
static DownloadStatusCallback cb;
5959

60-
static bool ExecuteSynchronous(const wchar_t* program, const wchar_t* params) noexcept
60+
static bool ExecuteSynchronous(const wchar_t* program, const wchar_t* params, const wchar_t* directory) noexcept
6161
{
6262
bool succ = false;
6363
SHELLEXECUTEINFOW ShExecInfo = {0};
@@ -67,7 +67,7 @@
6767
ShExecInfo.lpVerb = NULL;
6868
ShExecInfo.lpFile = program;
6969
ShExecInfo.lpParameters = params;
70-
ShExecInfo.lpDirectory = NULL;
70+
ShExecInfo.lpDirectory = directory;
7171
ShExecInfo.nShow = SW_HIDE;
7272
ShExecInfo.hInstApp = NULL;
7373
ShellExecuteExW(&ShExecInfo);
@@ -94,7 +94,7 @@ void OFS_DownloadFfmpeg::DownloadFfmpegModal() noexcept
9494
#ifdef WIN32
9595
static bool DownloadInProgress = false;
9696
static bool ExtractFailed = false;
97-
static auto ZipExists = Util::FileExists((Util::Basepath() / "ffmpeg.zip").u8string());
97+
static auto ZipExists = Util::FileExists(Util::Prefpath("ffmpeg.zip"));
9898

9999
bool isOpen = true;
100100
if(ImGui::BeginPopupModal(OFS_DownloadFfmpeg::ModalText, DownloadInProgress ? NULL : &isOpen, ImGuiWindowFlags_AlwaysAutoResize)) {
@@ -103,9 +103,9 @@ void OFS_DownloadFfmpeg::DownloadFfmpegModal() noexcept
103103
ImGui::TextUnformatted("ffmpeg.exe was not found.\nDo you want to download it?");
104104
if(ImGui::Button("Yes", ImVec2(-1.f, 0.f))) {
105105
auto dlThread = [](void* data) -> int {
106-
auto path = Util::Basepath();
107-
auto downloadPath = (path / "ffmpeg.zip").u8string();
108-
URLDownloadToFile(NULL, "https://www.gyan.dev/ffmpeg/builds/ffmpeg-release-essentials.zip",
106+
auto path = Util::PathFromString(Util::Prefpath());
107+
auto downloadPath =(path / "ffmpeg.zip").wstring();
108+
URLDownloadToFileW(NULL, L"https://www.gyan.dev/ffmpeg/builds/ffmpeg-release-essentials.zip",
109109
downloadPath.c_str(), 0, &cb);
110110
return 0;
111111
};
@@ -124,15 +124,16 @@ void OFS_DownloadFfmpeg::DownloadFfmpegModal() noexcept
124124
DownloadInProgress = false;
125125
ZipExists = true;
126126
std::wstringstream ss;
127-
auto path = Util::Basepath();
127+
auto path = Util::PathFromString(Util::Prefpath());
128128
auto downloadPath = (path / "ffmpeg.zip");
129129

130-
ss << L"-xvf ";
130+
ss << L" -xvf ";
131131
ss << L'"' << downloadPath.wstring() << L'"';
132132
ss << L" --strip-components 2 **/ffmpeg.exe";
133133

134134
auto params = ss.str();
135-
ExtractFailed = !ExecuteSynchronous(L"tar.exe", params.c_str());
135+
auto dir = Util::PathFromString(Util::Prefpath()).wstring();
136+
ExtractFailed = !ExecuteSynchronous(L"tar.exe", params.c_str(), dir.c_str());
136137

137138
if(!ExtractFailed) {
138139
FfmpegMissing = false;

0 commit comments

Comments
 (0)