diff --git a/package/common/shell.cpp b/package/common/shell.cpp index 166f72111..4ce3c9afa 100644 --- a/package/common/shell.cpp +++ b/package/common/shell.cpp @@ -1,7 +1,6 @@ #include // from the Perl distribution #include // from the Perl distribution - #ifdef WIN32 // Perl win32 specific includes, found in perl\\lib\\CORE\\win32.h // Defines the windows specific convenience RunPerl() function, @@ -17,13 +16,8 @@ int main(int argc, char **argv, char **env) { - // replaces following Windows batch file: @"%~dp0\perl5.24.0.exe" - // "%~dp0\slic3r.pl" --DataDir "C:\Users\Public\Documents\Prusa3D\Slic3r - // settings MK2"%* - // If the Slic3r is installed in a localized directory (containing non-iso // characters), spaces or semicolons, use short file names. - char exe_path[MAX_PATH] = {0}; char script_path[MAX_PATH]; char gui_flag[6] = {"--gui"}; diff --git a/package/win/autorun.bat b/package/win/autorun.bat deleted file mode 100644 index be2c7b3f0..000000000 --- a/package/win/autorun.bat +++ /dev/null @@ -1 +0,0 @@ -@perl5.24.0.exe slic3r.pl %* diff --git a/package/win/compile_wrapper.ps1 b/package/win/compile_wrapper.ps1 index abd929287..c5d603ef3 100644 --- a/package/win/compile_wrapper.ps1 +++ b/package/win/compile_wrapper.ps1 @@ -4,16 +4,27 @@ if ($args[0]) $perlver = $args[0] } else { - $perlver = 518 + $perlver = 524 } $perllib = "-lperl$perlver" $shell_loc = "..\common\shell.cpp" +# Build the resource file (used to load icon, etc) windres slic3r.rc -O coff -o slic3r.res + +# Compile an object file that does not have gui forced. g++ -c -I'C:\strawberry\perl\lib\CORE\' $shell_loc -o slic3r.o + +# Compile an object file with --gui automatically passed as an argument g++ -c -I'C:\strawberry\perl\lib\CORE\' -DFORCE_GUI $shell_loc -o slic3r-gui.o + +# Build the EXE for the unforced version as slic3r-console g++ -static-libgcc -static-libstdc++ -L'C:\strawberry\c\lib' -L'C:\strawberry\perl\bin' -L'C:\strawberry\perl\lib\CORE\' $perllib slic3r.o slic3r.res -o slic3r-console.exe | Write-Host + +# Build the EXE for the forced GUI g++ -static-libgcc -static-libstdc++ -L'C:\strawberry\c\lib' -mwindows -L'C:\strawberry\perl\bin' -L'C:\strawberry\perl\lib\CORE\' $perllib slic3r-gui.o slic3r.res -o slic3r.exe | Write-Host + +# Build an extra copy of the GUI version that creates a console window g++ -static-libgcc -static-libstdc++ -L'C:\strawberry\c\lib' -L'C:\strawberry\perl\bin' -L'C:\strawberry\perl\lib\CORE\' $perllib slic3r-gui.o slic3r.res -o slic3r-debug-console.exe | Write-Host diff --git a/package/win/package_win32.ps1 b/package/win/package_win32.ps1 index 1a98bcf27..07396ea37 100644 --- a/package/win/package_win32.ps1 +++ b/package/win/package_win32.ps1 @@ -1,7 +1,7 @@ -# Written by Joseph Lenox +# Written by Joseph Lenox # Licensed under the same license as the rest of Slic3r. # ------------------------ -# You need to have Strawberry Perl 5.24.0.1 installed for this to work, +# You need to have Strawberry Perl 5.24.0.1 (or slic3r-perl) installed for this to work, param ( [switch]$exe = $false )