team-ljyzipelo

공개

명령행 설치 경로를 고정해 제거 경로 불일치를 수정함

작성자
호시노 히나타
작성 시각
커밋
7e5fdce3459d6009297596f3c571b866adf7c560
부모
bcf9e37
이 시점의 파일 보기

변경된 파일 3개

+21-2
수정packaging/windows/rust/README.md+2-0
@@ -19,6 +19,8 @@ Cargo 1.99.1, Windows GNU Rust target, MinGW-w64와 makensis가 필요합니다.
1919
2020설치 파일을 더블클릭하면 현재 사용자의 LocalAppData/Programs/Zipelo-Dev에
2121Zipelo.exe, zipelo-archive-worker.exe, MIT LICENSE, BUILD-INFO.json과 제거 프로그램을 설치합니다.
22추가: 설치 경로는 위 위치로 고정되며 명령행 /D로 다른 위치를 지정해도 파일 쓰기 전에 고정 위치를 적용합니다.
23추가: 설치와 제거는 같은 경로 상수를 사용합니다.
2224기존 폴더나 등록이 있으면 중단하며 덮어쓰기 업데이트는 지원하지 않습니다.
2325시작 메뉴에 Zipelo 개발판 바로가기를 추가합니다.
2426
수정packaging/windows/rust/installer.nsi+5-2
@@ -6,7 +6,8 @@ Unicode true
66!include "FileFunc.nsh"
77Name "Zipelo 개발판"
88OutFile "Zipelo-0.1.0-dev-windows-x64-setup.exe"
9삭제: InstallDir "$LOCALAPPDATA\Programs\Zipelo-Dev"
9추가: !define INSTALLROOT "$LOCALAPPDATA\Programs\Zipelo-Dev"
10추가: InstallDir "${INSTALLROOT}"
1011RequestExecutionLevel user
1112SetCompressor /SOLID lzma
1213SetOverwrite off
@@ -50,6 +51,8 @@ Function .onInit
5051FunctionEnd
5152
5253Section "Zipelo"
54추가: ; /D로 바뀐 경로를 파일 쓰기 전에 고정하여 제거 경로와 일치시킴.
55추가: StrCpy $INSTDIR "${INSTALLROOT}"
5356 ; 기존 설치와 등록을 덮어쓰지 않음.
5457 IfFileExists "$INSTDIR" failed
5558 System::Call 'advapi32::RegOpenKeyExW(p 0x80000001, w "${APPKEY}", i 0, i 0x20119, *p.r1) i.r0'
@@ -205,7 +208,7 @@ Function un.onInit
205208 ${OrIf} $1 != 0
206209 Abort
207210 ${EndIf}
208삭제: StrCmp $INSTDIR "$LOCALAPPDATA\Programs\Zipelo-Dev" 0 invalid
211추가: StrCmp $INSTDIR "${INSTALLROOT}" 0 invalid
209212 ReadINIStr $0 "$INSTDIR\install.ini" "Zipelo" "Location"
210213 StrCmp $0 $INSTDIR 0 invalid
211214 Return
수정tests/ci/test_windows_installer.py+14-0
@@ -2,6 +2,7 @@ import argparse
22import importlib.util
33from pathlib import Path
44import struct
5추가: import re
56import shutil
67import subprocess
78import tempfile
@@ -66,6 +67,19 @@ class InstallerInputTests(unittest.TestCase):
6667 self.assertIn(MODULE.pe_machine(installer), (0x14C, 0x8664))
6768 self.assertGreater(installer.stat().st_size, 100000)
6869
70추가: def test_command_line_directory_is_reset_before_install_side_effects(self):
71추가: source = (ROOT / "packaging/windows/rust/installer.nsi").read_text()
72추가: section = source.split('Section "Zipelo"', 1)[1].split("SectionEnd", 1)[0]
73추가: commands = [line.strip() for line in section.splitlines()
74추가: if line.strip() and not line.strip().startswith(";")]
75추가: self.assertEqual(commands[0], 'StrCpy $INSTDIR "${INSTALLROOT}"')
76추가: root = re.search(r'^!define INSTALLROOT "([^"\n]+)"$', source, re.MULTILINE)
77추가: self.assertIsNotNone(root)
78추가: self.assertEqual(root.group(1), "$LOCALAPPDATA\\Programs\\Zipelo-Dev")
79추가: self.assertIn('InstallDir "${INSTALLROOT}"', source)
80추가: uninstaller = source.split("Function un.onInit", 1)[1].split("FunctionEnd", 1)[0]
81추가: self.assertIn('StrCmp $INSTDIR "${INSTALLROOT}" 0 invalid', uninstaller)
82추가:
6983 def test_source_commit_change_cannot_reuse_an_old_binary(self):
7084 repo = self.root / "source"
7185 repo.mkdir()