Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prompt for RelativeFilePaths in interactive update #431

Merged
merged 4 commits into from
Aug 23, 2023

Conversation

mdanish-kh
Copy link
Contributor

@mdanish-kh mdanish-kh commented Aug 12, 2023

Examples manifests to test with are included in the linked issue

Unmatched RelativeFilePaths can be categorized into 2 types with this PR

CASE-I Same binary name, different directory name

a. Single match for example.exe in the new archive

e.g. Example-1.2\example.exe -> Example-1.3\example.exe

In this case the autonomous and interactive update logic will auto-detect the new binary from the archive and user does not have to do anything.

b. Multiple matches for example.exe in the new archive

e.g. Example-1.2\win64\example.exe matches with Example-1.3\win64\example.exe and Example-1.3\win32\example.exe in the new archive.

In this case the autonomous update will fail as it cannot disambiguate which example.exe to use as the new RelativeFilePath (although the above example makes it seem obvious which to choose but we need a way to generalize for any case). Interactive update will match for all example.exe in the new archive and prompt the user to select one

CASE-II Different binary name under different directories

e.g. Example-1.2\example-1.2.exe -> Example-1.3\example-1.3.exe

Autonomous update will fail again for same reasons. Interactive update will now scan for all .exe (old relativefilepath extension) in the new archive and prompt the user to select one of them as new RelativeFilePath. If there are no .exe files in the new archive, the interactive update can't move any forward and an appropriate message is printed.


Microsoft Reviewers: codeflow:open?pullrequest=#431

@mdanish-kh mdanish-kh requested a review from a team as a code owner August 12, 2023 20:17
@mdanish-kh mdanish-kh requested review from yao-msft and ryfu-msft and removed request for a team August 12, 2023 20:17
@microsoft-github-policy-service microsoft-github-policy-service bot added Issue-Bug Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. labels Aug 12, 2023
src/WingetCreateCLI/Commands/UpdateCommand.cs Outdated Show resolved Hide resolved
src/WingetCreateCLI/Commands/UpdateCommand.cs Outdated Show resolved Hide resolved
src/WingetCreateCLI/Commands/UpdateCommand.cs Show resolved Hide resolved
src/WingetCreateCLI/Commands/UpdateCommand.cs Outdated Show resolved Hide resolved
src/WingetCreateCLI/Properties/Resources.resx Show resolved Hide resolved
@ryfu-msft
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@ryfu-msft ryfu-msft merged commit 3ad456d into microsoft:main Aug 23, 2023
4 checks passed
@mdanish-kh mdanish-kh deleted the promptForRelativeFilePaths branch August 23, 2023 17:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue-Bug Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Prompt for RelativeFilePaths if client cannot auto-detect
2 participants