raylibtech / rtools

rtools feedback and issues
17 stars 1 forks source link

[rInstallFriendly] Skipping directories on installation #32

Closed urosidoki closed 8 months ago

urosidoki commented 9 months ago

Hi.

I generated an installer with a zip file that contains multiple files + folders.

For some reason, there is a folder in the root called media that contains another folder internally called GameAssets. The installer is completely skipping the installation of that folder, everything else works fine.

Any idea what can be happening?

raysan5 commented 9 months ago

@urosidoki Thanks for reporting! Are those directories empty? Afaik, it shouldn't skip them, actually the .zip is embedded as is into the installer.

urosidoki commented 9 months ago

Hi

Directories are not empty

And the zip file seems to include the folder. I reproduced on Windows 11. I will try this afternoon on Windows 10.

On Mon, Nov 6, 2023, 12:49 Ray @.***> wrote:

@urosidoki https://github.com/urosidoki Thanks for reporting! Are those directories empty? Afaik, it shouldn't skip them, actually the .zip is embedded as is into the installer.

— Reply to this email directly, view it on GitHub https://github.com/raylibtech/rtools/issues/32#issuecomment-1794651259, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB6LOCTRZBZL7OR5L2DEU2DYDDFF7AVCNFSM6AAAAAA67LCBQGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTOOJUGY2TCMRVHE . You are receiving this because you were mentioned.Message ID: @.***>

raysan5 commented 9 months ago

@urosidoki do the included directories/files have Unicode names? For example Japanese or Chinnese characters.

Please, could you provide a small .zip file to reproduce the issue?

urosidoki commented 9 months ago

I got the feeling it is related to how the zip file is generated.

Try this one, it doesn't seem to work for me. The config folder doesn't appear.

submission_pc_opengl_package.zip

urosidoki commented 9 months ago

Just to provide more info, I am generating the zip file from a command line argument:

7z.exe a -tzip -spf -mmt ".\packaging\%output_folder%\%zip_file%.zip" @%inclusion_list%

I run a batch that first zips a bunch of files and then I execute the installer with the command line as well.

"rinstallfriendly.exe" --build .\packaging\general_installer.rif --input ".\packaging\%output_folder%\%zip_file%.zip" --output ".\packaging\%output_folder%\%zip_file%.exe"

But, to be sure the problem wasn't my command line for the installer I did the installer exe with the proper GUI menu as well, but I still have the problem.

urosidoki commented 9 months ago

This is what I got from the command line execution image

urosidoki commented 9 months ago

Hi,

Is there any update on this? Anything I can do to help?

raysan5 commented 9 months ago

@urosidoki sorry, not yet, I'm working on next raylib release and that's taking a considerable amount of work, I'll review it after the release, hopefully by December.

raysan5 commented 9 months ago

@urosidoki I reviewed this issue and I can reproduce it but I'm afraid it is related to the way the .zip is generated. For some reason, the zip stores a total of 22 paths but directories are not stored as separate elements, config/config.json is provided as a single path instead of two separate paths: config/ and config/config.json, as expected by the program.

I tried creating the same zip using two methods:

  1. Windows 10: Mouse menu over directory -> Send to compressed (zipped) folder -> submission_pc_opengl_package.windows.zip
  2. Windows 10: 7zip -> Add to submission_pc_opengl_package.zip -> submission_pc_opengl_package.7zip.zip

With those two methods it works... but not exactly the same way!

Option 1. detects a total of 23 paths, directories are procesed as separate paths... but the base directory is not registered (submission_pc_opengl_package/), for the config directory it registered as submission_pc_opengl_package/config/ (as expected).

Option 2. detects a total of 24 paths, directories and files are properly separated, including the base directory (submission_pc_opengl_package/), that's the expected structure for path creation and file creation.

I don't know the reason for those inconsistencies but, in any case I think I can address it with some additional checks (directory path validation), increasing a bit the processing cost.

urosidoki commented 9 months ago

Hi

Apologize for the late reply.

So it seems that adding files to a zip is causing the file to be different. That is interesting.

I think supporting that would be a great addition, the reason is, that if someone is using a batch file to generate the zip file + the installer it will always have this problem. I don’t know what would be the performance penalty on that, but I doubt it is something super expensive.

What do you think?

Cheers, Jose

On Tue, 14 Nov 2023 at 19:26, Ray @.***> wrote:

@urosidoki https://github.com/urosidoki I reviewed this issue and I can reproduce it but I'm afraid it is related to the way the .zip is generated. For some reason, the zip stores a total of 22 paths but directories are not stored as separate elements, config/config.json is provided as a single path instead of two separate paths: config/ and config/config.json, as expected by the program.

I tried creating the same zip using two methods:

  1. Windows 10: Mouse menu over directory -> Send to compressed (zipped) folder -> submission_pc_opengl_package.windows.zip https://github.com/raylibtech/rtools/files/13353762/submission_pc_opengl_package.windows.zip
  2. Windows 10: 7zip -> Add to submission_pc_opengl_package.zip -> submission_pc_opengl_package.7zip.zip https://github.com/raylibtech/rtools/files/13353763/submission_pc_opengl_package.7zip.zip

With those two methods it works... but not exactly the same way!

Option 1. detects a total of 23 paths, directories are procesed as separate paths... but the base directory is not registered ( submission_pc_opengl_package/), for the config directory it registered as submission_pc_opengl_package/config/ (as expected).

Option 2. detects a total of 24 paths, directories and files are properly separated, including the base directory (submission_pc_opengl_package/), that's the expected structure for path creation and file creation.

I don't know the reason for those inconsistencies but, in any case I think I can address it with some additional checks (directory path validation), increasing a bit the processing cost.

— Reply to this email directly, view it on GitHub https://github.com/raylibtech/rtools/issues/32#issuecomment-1810888352, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB6LOCTT44UX5LD5YFIBZBLYEOZV3AVCNFSM6AAAAAA67LCBQGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMJQHA4DQMZVGI . You are receiving this because you were mentioned.Message ID: @.***>

raysan5 commented 8 months ago

Checking for directory existence before decompressing any file works. I think the performance penalty is not that dramatic.