명령행 설치 경로를 고정해 제거 경로 불일치를 수정함
- 작성자
- 호시노 히나타
- 작성 시각
- 커밋
7e5fdce3459d6009297596f3c571b866adf7c560- 부모
- bcf9e37
변경된 파일 3개
+21-2| @@ -19,6 +19,8 @@ Cargo 1.99.1, Windows GNU Rust target, MinGW-w64와 makensis가 필요합니다. | ||
| 19 | 19 | |
| 20 | 20 | 설치 파일을 더블클릭하면 현재 사용자의 LocalAppData/Programs/Zipelo-Dev에 |
| 21 | 21 | Zipelo.exe, zipelo-archive-worker.exe, MIT LICENSE, BUILD-INFO.json과 제거 프로그램을 설치합니다. |
| 22 | 추가: 설치 경로는 위 위치로 고정되며 명령행 /D로 다른 위치를 지정해도 파일 쓰기 전에 고정 위치를 적용합니다. | |
| 23 | 추가: 설치와 제거는 같은 경로 상수를 사용합니다. | |
| 22 | 24 | 기존 폴더나 등록이 있으면 중단하며 덮어쓰기 업데이트는 지원하지 않습니다. |
| 23 | 25 | 시작 메뉴에 Zipelo 개발판 바로가기를 추가합니다. |
| 24 | 26 |
| @@ -6,7 +6,8 @@ Unicode true | ||
| 6 | 6 | !include "FileFunc.nsh" |
| 7 | 7 | Name "Zipelo 개발판" |
| 8 | 8 | OutFile "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}" | |
| 10 | 11 | RequestExecutionLevel user |
| 11 | 12 | SetCompressor /SOLID lzma |
| 12 | 13 | SetOverwrite off |
| @@ -50,6 +51,8 @@ Function .onInit | ||
| 50 | 51 | FunctionEnd |
| 51 | 52 | |
| 52 | 53 | Section "Zipelo" |
| 54 | 추가: ; /D로 바뀐 경로를 파일 쓰기 전에 고정하여 제거 경로와 일치시킴. | |
| 55 | 추가: StrCpy $INSTDIR "${INSTALLROOT}" | |
| 53 | 56 | ; 기존 설치와 등록을 덮어쓰지 않음. |
| 54 | 57 | IfFileExists "$INSTDIR" failed |
| 55 | 58 | System::Call 'advapi32::RegOpenKeyExW(p 0x80000001, w "${APPKEY}", i 0, i 0x20119, *p.r1) i.r0' |
| @@ -205,7 +208,7 @@ Function un.onInit | ||
| 205 | 208 | ${OrIf} $1 != 0 |
| 206 | 209 | Abort |
| 207 | 210 | ${EndIf} |
| 208 | 삭제: StrCmp $INSTDIR "$LOCALAPPDATA\Programs\Zipelo-Dev" 0 invalid | |
| 211 | 추가: StrCmp $INSTDIR "${INSTALLROOT}" 0 invalid | |
| 209 | 212 | ReadINIStr $0 "$INSTDIR\install.ini" "Zipelo" "Location" |
| 210 | 213 | StrCmp $0 $INSTDIR 0 invalid |
| 211 | 214 | Return |
| @@ -2,6 +2,7 @@ import argparse | ||
| 2 | 2 | import importlib.util |
| 3 | 3 | from pathlib import Path |
| 4 | 4 | import struct |
| 5 | 추가: import re | |
| 5 | 6 | import shutil |
| 6 | 7 | import subprocess |
| 7 | 8 | import tempfile |
| @@ -66,6 +67,19 @@ class InstallerInputTests(unittest.TestCase): | ||
| 66 | 67 | self.assertIn(MODULE.pe_machine(installer), (0x14C, 0x8664)) |
| 67 | 68 | self.assertGreater(installer.stat().st_size, 100000) |
| 68 | 69 | |
| 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 | 추가: | |
| 69 | 83 | def test_source_commit_change_cannot_reuse_an_old_binary(self): |
| 70 | 84 | repo = self.root / "source" |
| 71 | 85 | repo.mkdir() |