amake / innosetup-docker

Docker image to create Windows installer executables with Inno Setup
https://hub.docker.com/r/amake/innosetup
Creative Commons Zero v1.0 Universal
71 stars 31 forks source link

Innosetup doesn't include hidden files #6

Closed schwingkopf closed 2 years ago

schwingkopf commented 2 years ago

Hi, thanks for your phantastic container image!

However, I'm facing an issue where innosetup would not include a "linux" hidden file named .load-order-pyzmq-22.3.0 in the installer. Interestingly it does include it when I run innosetup natively on Windows, using the same iss script.

I suspect this has something to do with the interaction between wine and debian in your container image. Any ideas how to solve this?

Only tried using amake/innosetup:innosetup6

amake commented 2 years ago

I have no idea why that would be happening, but rather than some arcane stuff I would first look to your .dockerignore or something like that.

What is the output of this? Does it contain .load-order-pyzmq-22.3.0?

docker run --rm -it -v $(PWD):/work --entrypoint /bin/bash amake/innosetup:innosetup6 -c "ls -al /work"

(Run it from the directory you map to /work or replace $(PWD) with the appropriate path.)

schwingkopf commented 2 years ago

Hi, thanks for your response!

The output of above command contains the .load-order-pyzmq-22.3.0 file (when running from the subdirectory it's located in), so it's not an issue of docker itself. Also I'm not using a .dockerignore. Do you know of any command to check whether wine is seeing the file or not?

I tried running innosetup with manually modified file names:

amake commented 2 years ago

Thanks, I guess it's not a Docker-level ignoring issue then.

What about doing this to see if the Windows layer is able to see the file?

docker run --rm -it -v $(PWD):/work --entrypoint /usr/bin/wine amake/innosetup:innosetup6 cmd /c "dir z:\work"

I see e.g. https://stackoverflow.com/q/34050206/448068 which seems to indicate that InnoSetup explicitly skips "hidden" files. I guess on Linux dotfiles are considered "hidden" and on Windows they aren't. I'm not sure on what layer that is decided (filesystem?).

There is apparently a "Show dot files" option in winecfg but you can't run this from the Docker container and I'm not sure how to get the same effect via the CLI.

schwingkopf commented 2 years ago
docker run --rm -it -v $(PWD):/work --entrypoint /usr/bin/wine amake/innosetup:innosetup6 cmd /c "dir z:\work"

does not list the .load-order-pyzmq-22.3.0. But it appears in the list of hidden files

docker run --rm -it -v $(PWD):/work --entrypoint /usr/bin/wine amake/innosetup:innosetup6 cmd /c "dir z:\work /ah-d"

So the problem is indeed that dotfiles are considered hidden under wine.

Listing the files explicity, as proposed in your link, solves the problem for me, thanks for sharing that! Although I'm not fully happy with that as it requires manual checking for dotfiles upon each change of application code / packages therein.

It's a pity that innosetup does not provide a direct way to automatically include hidden files in wildcard expressions and it's not even documented.

Anyhow, thanks for your help and feel free to close the issue! (unless you know of a magic command that makes wine treat dotfiles as non-hidden on the container level)

amake commented 2 years ago

Unfortunately I just don't know enough about wine to address this issue.

I will leave the ticket open until a better solution is found.

amake commented 2 years ago

After much futzing around, I found that the "Show dot files" setting can be programmatically set with

wine reg add 'HKEY_CURRENT_USER\Software\Wine' /v ShowDotFiles /d Y

When I do this, I find that wine cmd /c "dir z:\work" does show dotfiles!

amake commented 2 years ago

Running the wine reg add command during the container build doesn't seem to make the change persistent! I can't figure out why this is. Maybe there's some way to force-flush the registry to disk?

This might be useful if it gets an answer.

amake commented 2 years ago

Related question and answer: https://serverfault.com/a/1090483/580200

amake commented 2 years ago

I think I've got this fixed in https://github.com/amake/innosetup-docker/commit/58e03cd2d38710858b82a088c894859339db12ce. I've pushed new versions for all maintained tags (latest, innosetup6, 64bit); could you see if this works for you?

schwingkopf commented 2 years ago

I can confirm that it now works with amake/innosetup:innosetup6, good work!

Any reason why the code in https://github.com/amake/innosetup-docker/commit/58e03cd2d38710858b82a088c894859339db12ce doesn't match the one you posted here https://serverfault.com/a/1090483/580200 ?

amake commented 2 years ago

Great! Thanks for confirming.

Any reason why the code in 58e03cd doesn't match the one you posted here https://serverfault.com/a/1090483/580200 ?

The answer I wrote on Server Fault assumes that the registry file already exists, so it waits for the file to be updated. In the Dockerfile for this project I moved the registry change to a point in time where the file does not yet exist, so instead we wait for it to be created.