Skip to content

Tile rename step fails when running on windows #35

@dbathgate

Description

@dbathgate

Describe the bug

The winfs-injector fails on the last step when attempting to rename the tile from a .pivotal.zip to a .pivotal file.
This issue is only reproducible on Windows (Windows 10, Windows Server 2019/2022).

Error Output:

rename C:\Temp\pas-windows-4.0.21-build.3-injected.pivotal.zip C:\Temp\pas-windows-4.0.21-build.3-injected.pivotal: The process cannot access the file because it is being used by another process.

Reproduction steps

  1. Run the winfs-injector on Windows
  2. Last step produces an error
  3. File remains pivotal.zip

Expected behavior

The injector should not fail on Windows and the output tile should have the extension .pivotal

Additional context

It seems that the github.com/jhoonb/archivex dependency used to create the zip is not correctly closing the zip file after completion. While it does seem to close the writer from zip.NewWriter, it does not close the file from os.Create.
https://github.com/jhoonb/archivex/blob/master/archivex.go#L64
On windows, this results in a permission denied because the file is still opened.

Local testing with a revised version of archivex seems to fix the issue.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions