GameMaker [SOLVED] zip_unzip() - How to save in a different location?

FoxyOfJungle

Kazan Games
The new version of Game Maker Studio 2.2.3.436 lets you disable the engine sandbox, this works with the "file_" functions, but doesn't work with zip_unzip().

Is there any way to extract a zip to any location outside of "appdata"?

I'm basically doing an update system, and I need to extract the files to the game folder...
(I'm currently using a primitive form with CMD).
 

rIKmAN

Member
Print your path to the console, it's possible it's not what you think it is due to escape characters in the path string.

Also someone else was having issues saving files to the game folder, search the forum and find the thread to see if he solved it, and in the meantime try saving to a folder that isn't the game folder just to rule it out. If you have more than 1 drive / partition try saving to the root of D or E or whatever drive letter is assigned to the drive that isn't C.
 

FoxyOfJungle

Kazan Games
Print your path to the console, it's possible it's not what you think it is due to escape characters in the path string.

Also someone else was having issues saving files to the game folder, search the forum and find the thread to see if he solved it, and in the meantime try saving to a folder that isn't the game folder just to rule it out. If you have more than 1 drive / partition try saving to the root of D or E or whatever drive letter is assigned to the drive that isn't C.
The paths are correct and I already did this check. I really don't know if this is an engine bug ..
I'm using this in keyboard key pressed event:

Code:
zip_unzip("C:\Temp\Archive.zip","C:\EXTRACTED");
The file has 2.82MB only.
Thank you.


https://marketplace.yoyogames.com/assets/5510/file-manager

You could always copy it out of your sandbox. They haven't added a directory_copy or directory_rename yet. What a pitty.

also the sandbox directory may be returned with game_save_id
I use your extension, it is very useful, but I would like to extract all files in a particular folder without having to copy one by one because your extension has no extraction functions.
Thank you.
 
Instead of
Code:
zip_unzip("C:\Temp\Archive.zip","C:\EXTRACTED");
have you tried it this way:
Code:
zip_unzip("C:\\Temp\\Archive.zip","C:\\EXTRACTED");
Because in GMS2, the \ character is an escape character used in strings (with things like \n for newline). You might also be able to do this:
Code:
zip_unzip(@"C:\Temp\Archive.zip",@"C:\EXTRACTED");
to turn do it as a string literal, which will take it verbatim.
 
Top