]> glassweightruler.freedombox.rocks Git - Ventoy.git/commitdiff
Add Ventoy Sparse Image Option
authorlongpanda <admin@ventoy.net>
Sat, 10 Jul 2021 01:41:52 +0000 (09:41 +0800)
committerlongpanda <admin@ventoy.net>
Sat, 10 Jul 2021 01:41:52 +0000 (09:41 +0800)
LANGUAGES/languages.json
Ventoy2Disk/Ventoy2Disk/Language.h
Ventoy2Disk/Ventoy2Disk/PhyDrive.c
Ventoy2Disk/Ventoy2Disk/Ventoy2Disk.c
Ventoy2Disk/Ventoy2Disk/Ventoy2Disk.h
Ventoy2Disk/Ventoy2Disk/WinDialog.c
Ventoy2Disk/Ventoy2Disk/ff14/source/diskio.c
Ventoy2Disk/Ventoy2Disk/ff14/source/ff.c

index 2857589f05d8b3e20f082ee7c815ca6bb0d372e8..158834dd426ed65b7948a88d89db3130116dfb69 100644 (file)
         "STR_WEB_SERVICE_UNAVAILABLE":"خطأ في الاتصال: الخدمة غير متوفرة",
         "STR_WEB_TOKEN_MISMATCH":"تم تحديث حالة البرنامج الخفي ، يرجى إعادة المحاولة لاحقًا.",
         "STR_WEB_SERVICE_BUSY":"الخدمة مشغولة ، يرجى إعادة المحاولة لاحقًا.",
         "STR_WEB_SERVICE_UNAVAILABLE":"خطأ في الاتصال: الخدمة غير متوفرة",
         "STR_WEB_TOKEN_MISMATCH":"تم تحديث حالة البرنامج الخفي ، يرجى إعادة المحاولة لاحقًا.",
         "STR_WEB_SERVICE_BUSY":"الخدمة مشغولة ، يرجى إعادة المحاولة لاحقًا.",
+        "STR_MENU_VTSI_CREATE":"Generate VTSI File",
+        "STR_VTSI_CREATE_TIP":"This time will not write to the device, but only generate a VTSI file#@Continue?",
+        "STR_VTSI_CREATE_SUCCESS":"VTSI file created successfully!#@You can use Rufus(3.15+) to write it to the device so as to complete the installation of Ventoy.",
+        "STR_VTSI_CREATE_FAILED":"VTSI file created failed.",
         "STRXXX":""
     },
     {
         "STRXXX":""
     },
     {
         "STR_WEB_SERVICE_UNAVAILABLE":"통신 오류: 서비스를 사용할 수 없음",
         "STR_WEB_TOKEN_MISMATCH":"데몬 상태가 업데이트되었습니다. 나중에 다시 시도하십시오.",
         "STR_WEB_SERVICE_BUSY":"서비스가 사용 중입니다. 나중에 다시 시도하십시오.",
         "STR_WEB_SERVICE_UNAVAILABLE":"통신 오류: 서비스를 사용할 수 없음",
         "STR_WEB_TOKEN_MISMATCH":"데몬 상태가 업데이트되었습니다. 나중에 다시 시도하십시오.",
         "STR_WEB_SERVICE_BUSY":"서비스가 사용 중입니다. 나중에 다시 시도하십시오.",
+        "STR_MENU_VTSI_CREATE":"Generate VTSI File",
+        "STR_VTSI_CREATE_TIP":"This time will not write to the device, but only generate a VTSI file#@Continue?",
+        "STR_VTSI_CREATE_SUCCESS":"VTSI file created successfully!#@You can use Rufus(3.15+) to write it to the device so as to complete the installation of Ventoy.",
+        "STR_VTSI_CREATE_FAILED":"VTSI file created failed.",
         "STRXXX":""
     },
     {
         "STRXXX":""
     },
     {
         "STR_WEB_SERVICE_UNAVAILABLE":"通信失败:服务不可用",
         "STR_WEB_TOKEN_MISMATCH":"后台服务状态更新,请稍后重试",
         "STR_WEB_SERVICE_BUSY":"后台服务正忙,请稍后重试",
         "STR_WEB_SERVICE_UNAVAILABLE":"通信失败:服务不可用",
         "STR_WEB_TOKEN_MISMATCH":"后台服务状态更新,请稍后重试",
         "STR_WEB_SERVICE_BUSY":"后台服务正忙,请稍后重试",
+        "STR_MENU_VTSI_CREATE":"创建 VTSI 文件",
+        "STR_VTSI_CREATE_TIP":"本操作不会向设备中写入数据,而只会生成一个 VTSI 文件#@是否继续?",
+        "STR_VTSI_CREATE_SUCCESS":"VTSI 文件创建成功,你可以使用Rufus(3.15+)将其写入对应设备,从而完成Ventoy的安装",
+        "STR_VTSI_CREATE_FAILED":"VTSI 文件创建失败",
         "STRXXX":""
     },
     {
         "STRXXX":""
     },
     {
         "STR_WEB_SERVICE_UNAVAILABLE":"Communication error: Service Unavailable",
         "STR_WEB_TOKEN_MISMATCH":"Daemon status updated, please retry later.",
         "STR_WEB_SERVICE_BUSY":"Service is busy, please retry later.",
         "STR_WEB_SERVICE_UNAVAILABLE":"Communication error: Service Unavailable",
         "STR_WEB_TOKEN_MISMATCH":"Daemon status updated, please retry later.",
         "STR_WEB_SERVICE_BUSY":"Service is busy, please retry later.",
+        "STR_MENU_VTSI_CREATE":"Generate VTSI File",
+        "STR_VTSI_CREATE_TIP":"This time will not write to the device, but only generate a VTSI file#@Continue?",
+        "STR_VTSI_CREATE_SUCCESS":"VTSI file created successfully!#@You can use Rufus(3.15+) to write it to the device so as to complete the installation of Ventoy.",
+        "STR_VTSI_CREATE_FAILED":"VTSI file created failed.",
         "STRXXX":""
     },
     {
         "STRXXX":""
     },
     {
         "STR_WEB_SERVICE_UNAVAILABLE":"خطای ارتباطی: سرویس موجود نیست",
         "STR_WEB_TOKEN_MISMATCH":"وضعیت Daemon به روز شد ، لطفاً بعداً دوباره امتحان کنید.",
         "STR_WEB_SERVICE_BUSY":"سرویس شلوغ است ، لطفاً بعداً دوباره امتحان کنید.",
         "STR_WEB_SERVICE_UNAVAILABLE":"خطای ارتباطی: سرویس موجود نیست",
         "STR_WEB_TOKEN_MISMATCH":"وضعیت Daemon به روز شد ، لطفاً بعداً دوباره امتحان کنید.",
         "STR_WEB_SERVICE_BUSY":"سرویس شلوغ است ، لطفاً بعداً دوباره امتحان کنید.",
+        "STR_MENU_VTSI_CREATE":"Generate VTSI File",
+        "STR_VTSI_CREATE_TIP":"This time will not write to the device, but only generate a VTSI file#@Continue?",
+        "STR_VTSI_CREATE_SUCCESS":"VTSI file created successfully!#@You can use Rufus(3.15+) to write it to the device so as to complete the installation of Ventoy.",
+        "STR_VTSI_CREATE_FAILED":"VTSI file created failed.",
         "STRXXX":""
     },
     {
         "STRXXX":""
     },
     {
         "STR_WEB_SERVICE_UNAVAILABLE":"Błąd komunikacji: usługa niedostępna",
         "STR_WEB_TOKEN_MISMATCH":"Stan daemona został zaktualizowany, spróbuj ponownie później.",
         "STR_WEB_SERVICE_BUSY":"Usługa jest zajęta, spróbuj ponownie później.",
         "STR_WEB_SERVICE_UNAVAILABLE":"Błąd komunikacji: usługa niedostępna",
         "STR_WEB_TOKEN_MISMATCH":"Stan daemona został zaktualizowany, spróbuj ponownie później.",
         "STR_WEB_SERVICE_BUSY":"Usługa jest zajęta, spróbuj ponownie później.",
+        "STR_MENU_VTSI_CREATE":"Generate VTSI File",
+        "STR_VTSI_CREATE_TIP":"This time will not write to the device, but only generate a VTSI file#@Continue?",
+        "STR_VTSI_CREATE_SUCCESS":"VTSI file created successfully!#@You can use Rufus(3.15+) to write it to the device so as to complete the installation of Ventoy.",
+        "STR_VTSI_CREATE_FAILED":"VTSI file created failed.",
         "STRXXX":""
     },
     {
         "STRXXX":""
     },
     {
         "STR_WEB_SERVICE_UNAVAILABLE":"Erro de comunicação: Serviço indisponível",
         "STR_WEB_TOKEN_MISMATCH":"Status daemon atualizado, por favor, tente novamente mais tarde.",
         "STR_WEB_SERVICE_BUSY":"O serviço está ocupado, por favor, tente novamente mais tarde.",
         "STR_WEB_SERVICE_UNAVAILABLE":"Erro de comunicação: Serviço indisponível",
         "STR_WEB_TOKEN_MISMATCH":"Status daemon atualizado, por favor, tente novamente mais tarde.",
         "STR_WEB_SERVICE_BUSY":"O serviço está ocupado, por favor, tente novamente mais tarde.",
+        "STR_MENU_VTSI_CREATE":"Generate VTSI File",
+        "STR_VTSI_CREATE_TIP":"This time will not write to the device, but only generate a VTSI file#@Continue?",
+        "STR_VTSI_CREATE_SUCCESS":"VTSI file created successfully!#@You can use Rufus(3.15+) to write it to the device so as to complete the installation of Ventoy.",
+        "STR_VTSI_CREATE_FAILED":"VTSI file created failed.",
         "STRXXX":""
     },
     {
         "STRXXX":""
     },
     {
         "STR_WEB_SERVICE_UNAVAILABLE":"Iletişim hatası: Uzaktan web erişim hizmeti erişilemez durumda",
         "STR_WEB_TOKEN_MISMATCH":"Daemon durumu güncellendi,lütfen daha sonra tekrar deneyiniz.",
         "STR_WEB_SERVICE_BUSY":"Hizmet meşgul, lütfen daha sonra tekrar deneyin.",
         "STR_WEB_SERVICE_UNAVAILABLE":"Iletişim hatası: Uzaktan web erişim hizmeti erişilemez durumda",
         "STR_WEB_TOKEN_MISMATCH":"Daemon durumu güncellendi,lütfen daha sonra tekrar deneyiniz.",
         "STR_WEB_SERVICE_BUSY":"Hizmet meşgul, lütfen daha sonra tekrar deneyin.",
+        "STR_MENU_VTSI_CREATE":"Generate VTSI File",
+        "STR_VTSI_CREATE_TIP":"This time will not write to the device, but only generate a VTSI file#@Continue?",
+        "STR_VTSI_CREATE_SUCCESS":"VTSI file created successfully!#@You can use Rufus(3.15+) to write it to the device so as to complete the installation of Ventoy.",
+        "STR_VTSI_CREATE_FAILED":"VTSI file created failed.",
         "STRXXX":""
     },
     {
         "STRXXX":""
     },
     {
         "STR_WEB_SERVICE_UNAVAILABLE":"Kommunikationsfehler: Dienst nicht verfügbar",
         "STR_WEB_TOKEN_MISMATCH":"Daemon-Status aktualisiert, bitte später erneut versuchen.",
         "STR_WEB_SERVICE_BUSY":"Dienst ist ausgelastet, bitte später erneut versuchen.",
         "STR_WEB_SERVICE_UNAVAILABLE":"Kommunikationsfehler: Dienst nicht verfügbar",
         "STR_WEB_TOKEN_MISMATCH":"Daemon-Status aktualisiert, bitte später erneut versuchen.",
         "STR_WEB_SERVICE_BUSY":"Dienst ist ausgelastet, bitte später erneut versuchen.",
+        "STR_MENU_VTSI_CREATE":"Generate VTSI File",
+        "STR_VTSI_CREATE_TIP":"This time will not write to the device, but only generate a VTSI file#@Continue?",
+        "STR_VTSI_CREATE_SUCCESS":"VTSI file created successfully!#@You can use Rufus(3.15+) to write it to the device so as to complete the installation of Ventoy.",
+        "STR_VTSI_CREATE_FAILED":"VTSI file created failed.",
         "STRXXX":""
     },
     {
         "STRXXX":""
     },
     {
         "STR_WEB_SERVICE_UNAVAILABLE":"Error de comunicacion : servici pas disponible",
         "STR_WEB_TOKEN_MISMATCH":"Estat del Daemon actualizat, tornatz ensajar mai tard.",
         "STR_WEB_SERVICE_BUSY":"Lo servici es ocupat, tornatz ensajar mai tard.",
         "STR_WEB_SERVICE_UNAVAILABLE":"Error de comunicacion : servici pas disponible",
         "STR_WEB_TOKEN_MISMATCH":"Estat del Daemon actualizat, tornatz ensajar mai tard.",
         "STR_WEB_SERVICE_BUSY":"Lo servici es ocupat, tornatz ensajar mai tard.",
+        "STR_MENU_VTSI_CREATE":"Generate VTSI File",
+        "STR_VTSI_CREATE_TIP":"This time will not write to the device, but only generate a VTSI file#@Continue?",
+        "STR_VTSI_CREATE_SUCCESS":"VTSI file created successfully!#@You can use Rufus(3.15+) to write it to the device so as to complete the installation of Ventoy.",
+        "STR_VTSI_CREATE_FAILED":"VTSI file created failed.",
         "STRXXX":""
     },
     {
         "STRXXX":""
     },
     {
         "STR_WEB_SERVICE_UNAVAILABLE":"Erreur de communication : service inaccessible",
         "STR_WEB_TOKEN_MISMATCH":"Statut du démon mis à jour, veuillez réessayer plus tard.",
         "STR_WEB_SERVICE_BUSY":"Service surchargé, veuillez réessayer plus tard.",
         "STR_WEB_SERVICE_UNAVAILABLE":"Erreur de communication : service inaccessible",
         "STR_WEB_TOKEN_MISMATCH":"Statut du démon mis à jour, veuillez réessayer plus tard.",
         "STR_WEB_SERVICE_BUSY":"Service surchargé, veuillez réessayer plus tard.",
+        "STR_MENU_VTSI_CREATE":"Generate VTSI File",
+        "STR_VTSI_CREATE_TIP":"This time will not write to the device, but only generate a VTSI file#@Continue?",
+        "STR_VTSI_CREATE_SUCCESS":"VTSI file created successfully!#@You can use Rufus(3.15+) to write it to the device so as to complete the installation of Ventoy.",
+        "STR_VTSI_CREATE_FAILED":"VTSI file created failed.",
         "STRXXX":""
     },
     {
         "STRXXX":""
     },
     {
         "STR_WEB_SERVICE_UNAVAILABLE":"Communication error: Service Unavailable",
         "STR_WEB_TOKEN_MISMATCH":"Daemon status updated, please retry later.",
         "STR_WEB_SERVICE_BUSY":"Service is busy, please retry later.",
         "STR_WEB_SERVICE_UNAVAILABLE":"Communication error: Service Unavailable",
         "STR_WEB_TOKEN_MISMATCH":"Daemon status updated, please retry later.",
         "STR_WEB_SERVICE_BUSY":"Service is busy, please retry later.",
+        "STR_MENU_VTSI_CREATE":"Generate VTSI File",
+        "STR_VTSI_CREATE_TIP":"This time will not write to the device, but only generate a VTSI file#@Continue?",
+        "STR_VTSI_CREATE_SUCCESS":"VTSI file created successfully!#@You can use Rufus(3.15+) to write it to the device so as to complete the installation of Ventoy.",
+        "STR_VTSI_CREATE_FAILED":"VTSI file created failed.",
         "STRXXX":""
     },
     {
         "STRXXX":""
     },
     {
         "STR_WEB_SERVICE_UNAVAILABLE":"Error de comunicación: Servicio No Disponible",
         "STR_WEB_TOKEN_MISMATCH":" Estado del daemon actualizado, por favor reintenta más tarde.",
         "STR_WEB_SERVICE_BUSY":" El servicio está ocupado, por favor reintenta más tarde.",
         "STR_WEB_SERVICE_UNAVAILABLE":"Error de comunicación: Servicio No Disponible",
         "STR_WEB_TOKEN_MISMATCH":" Estado del daemon actualizado, por favor reintenta más tarde.",
         "STR_WEB_SERVICE_BUSY":" El servicio está ocupado, por favor reintenta más tarde.",
+        "STR_MENU_VTSI_CREATE":"Generate VTSI File",
+        "STR_VTSI_CREATE_TIP":"This time will not write to the device, but only generate a VTSI file#@Continue?",
+        "STR_VTSI_CREATE_SUCCESS":"VTSI file created successfully!#@You can use Rufus(3.15+) to write it to the device so as to complete the installation of Ventoy.",
+        "STR_VTSI_CREATE_FAILED":"VTSI file created failed.",
         "STRXXX":""
     },
     {
         "STRXXX":""
     },
     {
         "STR_WEB_SERVICE_UNAVAILABLE":"Ошибка связи: Служба недоступна",
         "STR_WEB_TOKEN_MISMATCH":"Статус демона обновлен. Повторите попытку позже.",
         "STR_WEB_SERVICE_BUSY":"Служба занята, повторите попытку позже.",
         "STR_WEB_SERVICE_UNAVAILABLE":"Ошибка связи: Служба недоступна",
         "STR_WEB_TOKEN_MISMATCH":"Статус демона обновлен. Повторите попытку позже.",
         "STR_WEB_SERVICE_BUSY":"Служба занята, повторите попытку позже.",
+        "STR_MENU_VTSI_CREATE":"Generate VTSI File",
+        "STR_VTSI_CREATE_TIP":"This time will not write to the device, but only generate a VTSI file#@Continue?",
+        "STR_VTSI_CREATE_SUCCESS":"VTSI file created successfully!#@You can use Rufus(3.15+) to write it to the device so as to complete the installation of Ventoy.",
+        "STR_VTSI_CREATE_FAILED":"VTSI file created failed.",
         "STRXXX":""
     },
     {
         "STRXXX":""
     },
     {
         "STR_WEB_SERVICE_UNAVAILABLE":"Communication error: Service Unavailable",
         "STR_WEB_TOKEN_MISMATCH":"Daemon status updated, please retry later.",
         "STR_WEB_SERVICE_BUSY":"Service is busy, please retry later.",
         "STR_WEB_SERVICE_UNAVAILABLE":"Communication error: Service Unavailable",
         "STR_WEB_TOKEN_MISMATCH":"Daemon status updated, please retry later.",
         "STR_WEB_SERVICE_BUSY":"Service is busy, please retry later.",
+        "STR_MENU_VTSI_CREATE":"Generate VTSI File",
+        "STR_VTSI_CREATE_TIP":"This time will not write to the device, but only generate a VTSI file#@Continue?",
+        "STR_VTSI_CREATE_SUCCESS":"VTSI file created successfully!#@You can use Rufus(3.15+) to write it to the device so as to complete the installation of Ventoy.",
+        "STR_VTSI_CREATE_FAILED":"VTSI file created failed.",
         "STRXXX":""
     },
     {
         "STRXXX":""
     },
     {
         "STR_WEB_SERVICE_UNAVAILABLE":"Communication error: Service Unavailable",
         "STR_WEB_TOKEN_MISMATCH":"Daemon status updated, please retry later.",
         "STR_WEB_SERVICE_BUSY":"Service is busy, please retry later.",
         "STR_WEB_SERVICE_UNAVAILABLE":"Communication error: Service Unavailable",
         "STR_WEB_TOKEN_MISMATCH":"Daemon status updated, please retry later.",
         "STR_WEB_SERVICE_BUSY":"Service is busy, please retry later.",
+        "STR_MENU_VTSI_CREATE":"Generate VTSI File",
+        "STR_VTSI_CREATE_TIP":"This time will not write to the device, but only generate a VTSI file#@Continue?",
+        "STR_VTSI_CREATE_SUCCESS":"VTSI file created successfully!#@You can use Rufus(3.15+) to write it to the device so as to complete the installation of Ventoy.",
+        "STR_VTSI_CREATE_FAILED":"VTSI file created failed.",
         "STRXXX":""
     },
     {
         "STRXXX":""
     },
     {
         "STR_WEB_SERVICE_UNAVAILABLE":"Communicatiefout: service niet beschikbaar",
         "STR_WEB_TOKEN_MISMATCH":"Daemon-status bijgewerkt, probeer het later opnieuw.",
         "STR_WEB_SERVICE_BUSY":"Service is bezet, probeer het later opnieuw.",
         "STR_WEB_SERVICE_UNAVAILABLE":"Communicatiefout: service niet beschikbaar",
         "STR_WEB_TOKEN_MISMATCH":"Daemon-status bijgewerkt, probeer het later opnieuw.",
         "STR_WEB_SERVICE_BUSY":"Service is bezet, probeer het later opnieuw.",
+        "STR_MENU_VTSI_CREATE":"Generate VTSI File",
+        "STR_VTSI_CREATE_TIP":"This time will not write to the device, but only generate a VTSI file#@Continue?",
+        "STR_VTSI_CREATE_SUCCESS":"VTSI file created successfully!#@You can use Rufus(3.15+) to write it to the device so as to complete the installation of Ventoy.",
+        "STR_VTSI_CREATE_FAILED":"VTSI file created failed.",
         "STRXXX":""
     },
     {
         "STRXXX":""
     },
     {
         "STR_WEB_SERVICE_UNAVAILABLE":"Communication error: Service Unavailable",
         "STR_WEB_TOKEN_MISMATCH":"Daemon status updated, please retry later.",
         "STR_WEB_SERVICE_BUSY":"Service is busy, please retry later.",
         "STR_WEB_SERVICE_UNAVAILABLE":"Communication error: Service Unavailable",
         "STR_WEB_TOKEN_MISMATCH":"Daemon status updated, please retry later.",
         "STR_WEB_SERVICE_BUSY":"Service is busy, please retry later.",
+        "STR_MENU_VTSI_CREATE":"Generate VTSI File",
+        "STR_VTSI_CREATE_TIP":"This time will not write to the device, but only generate a VTSI file#@Continue?",
+        "STR_VTSI_CREATE_SUCCESS":"VTSI file created successfully!#@You can use Rufus(3.15+) to write it to the device so as to complete the installation of Ventoy.",
+        "STR_VTSI_CREATE_FAILED":"VTSI file created failed.",
         "STRXXX":""
     },
     {
         "STRXXX":""
     },
     {
         "STR_WEB_SERVICE_UNAVAILABLE":"Communication error: Service Unavailable",
         "STR_WEB_TOKEN_MISMATCH":"デーモンのステータスが更新されました。しばらくしてから再試行してください。",
         "STR_WEB_SERVICE_BUSY":"サービスがビジーです。後で再試行してください。",
         "STR_WEB_SERVICE_UNAVAILABLE":"Communication error: Service Unavailable",
         "STR_WEB_TOKEN_MISMATCH":"デーモンのステータスが更新されました。しばらくしてから再試行してください。",
         "STR_WEB_SERVICE_BUSY":"サービスがビジーです。後で再試行してください。",
+        "STR_MENU_VTSI_CREATE":"Generate VTSI File",
+        "STR_VTSI_CREATE_TIP":"This time will not write to the device, but only generate a VTSI file#@Continue?",
+        "STR_VTSI_CREATE_SUCCESS":"VTSI file created successfully!#@You can use Rufus(3.15+) to write it to the device so as to complete the installation of Ventoy.",
+        "STR_VTSI_CREATE_FAILED":"VTSI file created failed.",
         "STRXXX":""
     },
     {
         "STRXXX":""
     },
     {
         "STR_WEB_SERVICE_UNAVAILABLE":"Communication error: Service Unavailable",
         "STR_WEB_TOKEN_MISMATCH":"Daemon status updated, please retry later.",
         "STR_WEB_SERVICE_BUSY":"Service is busy, please retry later.",
         "STR_WEB_SERVICE_UNAVAILABLE":"Communication error: Service Unavailable",
         "STR_WEB_TOKEN_MISMATCH":"Daemon status updated, please retry later.",
         "STR_WEB_SERVICE_BUSY":"Service is busy, please retry later.",
+        "STR_MENU_VTSI_CREATE":"Generate VTSI File",
+        "STR_VTSI_CREATE_TIP":"This time will not write to the device, but only generate a VTSI file#@Continue?",
+        "STR_VTSI_CREATE_SUCCESS":"VTSI file created successfully!#@You can use Rufus(3.15+) to write it to the device so as to complete the installation of Ventoy.",
+        "STR_VTSI_CREATE_FAILED":"VTSI file created failed.",
         "STRXXX":""
     },
     {
         "STRXXX":""
     },
     {
         "STR_WEB_SERVICE_UNAVAILABLE":"Communication error: Service Unavailable",
         "STR_WEB_TOKEN_MISMATCH":"Daemon status updated, please retry later.",
         "STR_WEB_SERVICE_BUSY":"Service is busy, please retry later.",
         "STR_WEB_SERVICE_UNAVAILABLE":"Communication error: Service Unavailable",
         "STR_WEB_TOKEN_MISMATCH":"Daemon status updated, please retry later.",
         "STR_WEB_SERVICE_BUSY":"Service is busy, please retry later.",
+        "STR_MENU_VTSI_CREATE":"Generate VTSI File",
+        "STR_VTSI_CREATE_TIP":"This time will not write to the device, but only generate a VTSI file#@Continue?",
+        "STR_VTSI_CREATE_SUCCESS":"VTSI file created successfully!#@You can use Rufus(3.15+) to write it to the device so as to complete the installation of Ventoy.",
+        "STR_VTSI_CREATE_FAILED":"VTSI file created failed.",
         "STRXXX":""
     },
     {
         "STRXXX":""
     },
     {
         "STR_WEB_SERVICE_UNAVAILABLE":"Communication error: Service Unavailable",
         "STR_WEB_TOKEN_MISMATCH":"Daemon status updated, please retry later.",
         "STR_WEB_SERVICE_BUSY":"Service is busy, please retry later.",
         "STR_WEB_SERVICE_UNAVAILABLE":"Communication error: Service Unavailable",
         "STR_WEB_TOKEN_MISMATCH":"Daemon status updated, please retry later.",
         "STR_WEB_SERVICE_BUSY":"Service is busy, please retry later.",
+        "STR_MENU_VTSI_CREATE":"Generate VTSI File",
+        "STR_VTSI_CREATE_TIP":"This time will not write to the device, but only generate a VTSI file#@Continue?",
+        "STR_VTSI_CREATE_SUCCESS":"VTSI file created successfully!#@You can use Rufus(3.15+) to write it to the device so as to complete the installation of Ventoy.",
+        "STR_VTSI_CREATE_FAILED":"VTSI file created failed.",
         "STRXXX":""
     },
     {
         "STRXXX":""
     },
     {
         "STR_WEB_SERVICE_UNAVAILABLE":"通信錯誤: 服務不可用",
         "STR_WEB_TOKEN_MISMATCH":"服務狀態已更新",
         "STR_WEB_SERVICE_BUSY":"服務正忙,請稍後重試",
         "STR_WEB_SERVICE_UNAVAILABLE":"通信錯誤: 服務不可用",
         "STR_WEB_TOKEN_MISMATCH":"服務狀態已更新",
         "STR_WEB_SERVICE_BUSY":"服務正忙,請稍後重試",
+        "STR_MENU_VTSI_CREATE":"Generate VTSI File",
+        "STR_VTSI_CREATE_TIP":"This time will not write to the device, but only generate a VTSI file#@Continue?",
+        "STR_VTSI_CREATE_SUCCESS":"VTSI file created successfully!#@You can use Rufus(3.15+) to write it to the device so as to complete the installation of Ventoy.",
+        "STR_VTSI_CREATE_FAILED":"VTSI file created failed.",
         "STRXXX":""
     },
     {
         "STRXXX":""
     },
     {
         "STR_WEB_SERVICE_UNAVAILABLE":"Greška u komunikaciji: Servis nije dostupan",
         "STR_WEB_TOKEN_MISMATCH":"Status demona ažuriran, pokušajte ponovo kasnije.",
         "STR_WEB_SERVICE_BUSY":"Servis je zauzet, pokušajte ponovo kasnije.",
         "STR_WEB_SERVICE_UNAVAILABLE":"Greška u komunikaciji: Servis nije dostupan",
         "STR_WEB_TOKEN_MISMATCH":"Status demona ažuriran, pokušajte ponovo kasnije.",
         "STR_WEB_SERVICE_BUSY":"Servis je zauzet, pokušajte ponovo kasnije.",
+        "STR_MENU_VTSI_CREATE":"Generate VTSI File",
+        "STR_VTSI_CREATE_TIP":"This time will not write to the device, but only generate a VTSI file#@Continue?",
+        "STR_VTSI_CREATE_SUCCESS":"VTSI file created successfully!#@You can use Rufus(3.15+) to write it to the device so as to complete the installation of Ventoy.",
+        "STR_VTSI_CREATE_FAILED":"VTSI file created failed.",
         "STRXXX":""
     },
     {
         "STRXXX":""
     },
     {
         "STR_WEB_SERVICE_UNAVAILABLE":"Комуникациона грешка: Сервис је недоступан",
         "STR_WEB_TOKEN_MISMATCH":"Статус демона ажуриран, покушајте поново касније.",
         "STR_WEB_SERVICE_BUSY":"Севис је заузет, покушајте поново касније.",
         "STR_WEB_SERVICE_UNAVAILABLE":"Комуникациона грешка: Сервис је недоступан",
         "STR_WEB_TOKEN_MISMATCH":"Статус демона ажуриран, покушајте поново касније.",
         "STR_WEB_SERVICE_BUSY":"Севис је заузет, покушајте поново касније.",
+        "STR_MENU_VTSI_CREATE":"Generate VTSI File",
+        "STR_VTSI_CREATE_TIP":"This time will not write to the device, but only generate a VTSI file#@Continue?",
+        "STR_VTSI_CREATE_SUCCESS":"VTSI file created successfully!#@You can use Rufus(3.15+) to write it to the device so as to complete the installation of Ventoy.",
+        "STR_VTSI_CREATE_FAILED":"VTSI file created failed.",
         "STRXXX":""
     },
     {
         "STRXXX":""
     },
     {
         "STR_WEB_SERVICE_UNAVAILABLE":"Communication error: Service Unavailable",
         "STR_WEB_TOKEN_MISMATCH":"Daemon status updated, please retry later.",
         "STR_WEB_SERVICE_BUSY":"Service is busy, please retry later.",
         "STR_WEB_SERVICE_UNAVAILABLE":"Communication error: Service Unavailable",
         "STR_WEB_TOKEN_MISMATCH":"Daemon status updated, please retry later.",
         "STR_WEB_SERVICE_BUSY":"Service is busy, please retry later.",
+        "STR_MENU_VTSI_CREATE":"Generate VTSI File",
+        "STR_VTSI_CREATE_TIP":"This time will not write to the device, but only generate a VTSI file#@Continue?",
+        "STR_VTSI_CREATE_SUCCESS":"VTSI file created successfully!#@You can use Rufus(3.15+) to write it to the device so as to complete the installation of Ventoy.",
+        "STR_VTSI_CREATE_FAILED":"VTSI file created failed.",
         "STRXXX":""
     },
     {
         "STRXXX":""
     },
     {
         "STR_WEB_SERVICE_UNAVAILABLE":"Kommunikasjonsfeil: Tjeneste utilgjengelig",
         "STR_WEB_TOKEN_MISMATCH":"Daemon status er oppdatert, vennligst prøv igjen senere.",
         "STR_WEB_SERVICE_BUSY":"Tjenesten er opptatt, vennligst prøv igjen senere.",
         "STR_WEB_SERVICE_UNAVAILABLE":"Kommunikasjonsfeil: Tjeneste utilgjengelig",
         "STR_WEB_TOKEN_MISMATCH":"Daemon status er oppdatert, vennligst prøv igjen senere.",
         "STR_WEB_SERVICE_BUSY":"Tjenesten er opptatt, vennligst prøv igjen senere.",
+        "STR_MENU_VTSI_CREATE":"Generate VTSI File",
+        "STR_VTSI_CREATE_TIP":"This time will not write to the device, but only generate a VTSI file#@Continue?",
+        "STR_VTSI_CREATE_SUCCESS":"VTSI file created successfully!#@You can use Rufus(3.15+) to write it to the device so as to complete the installation of Ventoy.",
+        "STR_VTSI_CREATE_FAILED":"VTSI file created failed.",
         "STRXXX":""
     },
     {
         "STRXXX":""
     },
     {
         "STR_WEB_SERVICE_UNAVAILABLE":"Lỗi giao tiếp: Dịch vụ không sẵn có",
         "STR_WEB_TOKEN_MISMATCH":"Đã cập nhật trạng thái Daemon, vui lòng thử lại sau.",
         "STR_WEB_SERVICE_BUSY":"Dịch vụ bận, vui lòng thử lại sau.",
         "STR_WEB_SERVICE_UNAVAILABLE":"Lỗi giao tiếp: Dịch vụ không sẵn có",
         "STR_WEB_TOKEN_MISMATCH":"Đã cập nhật trạng thái Daemon, vui lòng thử lại sau.",
         "STR_WEB_SERVICE_BUSY":"Dịch vụ bận, vui lòng thử lại sau.",
+        "STR_MENU_VTSI_CREATE":"Generate VTSI File",
+        "STR_VTSI_CREATE_TIP":"This time will not write to the device, but only generate a VTSI file#@Continue?",
+        "STR_VTSI_CREATE_SUCCESS":"VTSI file created successfully!#@You can use Rufus(3.15+) to write it to the device so as to complete the installation of Ventoy.",
+        "STR_VTSI_CREATE_FAILED":"VTSI file created failed.",
         "STRXXX":""
     },
     {
         "STRXXX":""
     },
     {
         "STR_WEB_SERVICE_UNAVAILABLE":"Communication error: Service Unavailable",
         "STR_WEB_TOKEN_MISMATCH":"Daemon status updated, please retry later.",
         "STR_WEB_SERVICE_BUSY":"Service is busy, please retry later.",
         "STR_WEB_SERVICE_UNAVAILABLE":"Communication error: Service Unavailable",
         "STR_WEB_TOKEN_MISMATCH":"Daemon status updated, please retry later.",
         "STR_WEB_SERVICE_BUSY":"Service is busy, please retry later.",
+        "STR_MENU_VTSI_CREATE":"Generate VTSI File",
+        "STR_VTSI_CREATE_TIP":"This time will not write to the device, but only generate a VTSI file#@Continue?",
+        "STR_VTSI_CREATE_SUCCESS":"VTSI file created successfully!#@You can use Rufus(3.15+) to write it to the device so as to complete the installation of Ventoy.",
+        "STR_VTSI_CREATE_FAILED":"VTSI file created failed.",
         "STRXXX":""
     },
     {
         "STRXXX":""
     },
     {
         "STR_WEB_SERVICE_UNAVAILABLE":"Комуникациска грешка: Недостапен сервис",
         "STR_WEB_TOKEN_MISMATCH":"Ажуриран статус на даемонот, молиме обидете се подоцна.",
         "STR_WEB_SERVICE_BUSY":"Сервисот е зафатен, молиме обидете се подоцна.",
         "STR_WEB_SERVICE_UNAVAILABLE":"Комуникациска грешка: Недостапен сервис",
         "STR_WEB_TOKEN_MISMATCH":"Ажуриран статус на даемонот, молиме обидете се подоцна.",
         "STR_WEB_SERVICE_BUSY":"Сервисот е зафатен, молиме обидете се подоцна.",
+        "STR_MENU_VTSI_CREATE":"Generate VTSI File",
+        "STR_VTSI_CREATE_TIP":"This time will not write to the device, but only generate a VTSI file#@Continue?",
+        "STR_VTSI_CREATE_SUCCESS":"VTSI file created successfully!#@You can use Rufus(3.15+) to write it to the device so as to complete the installation of Ventoy.",
+        "STR_VTSI_CREATE_FAILED":"VTSI file created failed.",
         "STRXXX":""
     },
     {
         "STRXXX":""
     },
     {
         "STR_WEB_SERVICE_UNAVAILABLE":"Communication error: Service Unavailable",
         "STR_WEB_TOKEN_MISMATCH":"Daemon status updated, please retry later.",
         "STR_WEB_SERVICE_BUSY":"Service is busy, please retry later.",
         "STR_WEB_SERVICE_UNAVAILABLE":"Communication error: Service Unavailable",
         "STR_WEB_TOKEN_MISMATCH":"Daemon status updated, please retry later.",
         "STR_WEB_SERVICE_BUSY":"Service is busy, please retry later.",
+        "STR_MENU_VTSI_CREATE":"Generate VTSI File",
+        "STR_VTSI_CREATE_TIP":"This time will not write to the device, but only generate a VTSI file#@Continue?",
+        "STR_VTSI_CREATE_SUCCESS":"VTSI file created successfully!#@You can use Rufus(3.15+) to write it to the device so as to complete the installation of Ventoy.",
+        "STR_VTSI_CREATE_FAILED":"VTSI file created failed.",
         "STRXXX":""
     },
     {
         "STRXXX":""
     },
     {
         "STR_WEB_SERVICE_UNAVAILABLE":"Communication error: Service Unavailable",
         "STR_WEB_TOKEN_MISMATCH":"Daemon status updated, please retry later.",
         "STR_WEB_SERVICE_BUSY":"Service is busy, please retry later.",
         "STR_WEB_SERVICE_UNAVAILABLE":"Communication error: Service Unavailable",
         "STR_WEB_TOKEN_MISMATCH":"Daemon status updated, please retry later.",
         "STR_WEB_SERVICE_BUSY":"Service is busy, please retry later.",
+        "STR_MENU_VTSI_CREATE":"Generate VTSI File",
+        "STR_VTSI_CREATE_TIP":"This time will not write to the device, but only generate a VTSI file#@Continue?",
+        "STR_VTSI_CREATE_SUCCESS":"VTSI file created successfully!#@You can use Rufus(3.15+) to write it to the device so as to complete the installation of Ventoy.",
+        "STR_VTSI_CREATE_FAILED":"VTSI file created failed.",
         "STRXXX":""
     },
     {
         "STRXXX":""
     },
     {
         "STR_WEB_SERVICE_UNAVAILABLE":"Communication error: Service Unavailable",
         "STR_WEB_TOKEN_MISMATCH":"Daemon status updated, please retry later.",
         "STR_WEB_SERVICE_BUSY":"Service is busy, please retry later.",
         "STR_WEB_SERVICE_UNAVAILABLE":"Communication error: Service Unavailable",
         "STR_WEB_TOKEN_MISMATCH":"Daemon status updated, please retry later.",
         "STR_WEB_SERVICE_BUSY":"Service is busy, please retry later.",
+        "STR_MENU_VTSI_CREATE":"Generate VTSI File",
+        "STR_VTSI_CREATE_TIP":"This time will not write to the device, but only generate a VTSI file#@Continue?",
+        "STR_VTSI_CREATE_SUCCESS":"VTSI file created successfully!#@You can use Rufus(3.15+) to write it to the device so as to complete the installation of Ventoy.",
+        "STR_VTSI_CREATE_FAILED":"VTSI file created failed.",
         "STRXXX":""
     },
     {
         "STRXXX":""
     },
     {
         "STR_WEB_SERVICE_UNAVAILABLE":"Помилка зв'язку: Служба недоступна",
         "STR_WEB_TOKEN_MISMATCH":"Статус демона оновлено. Повторіть спробу пізніше.",
         "STR_WEB_SERVICE_BUSY":"Служба зайнята, повторіть спробу пізніше.",
         "STR_WEB_SERVICE_UNAVAILABLE":"Помилка зв'язку: Служба недоступна",
         "STR_WEB_TOKEN_MISMATCH":"Статус демона оновлено. Повторіть спробу пізніше.",
         "STR_WEB_SERVICE_BUSY":"Служба зайнята, повторіть спробу пізніше.",
+        "STR_MENU_VTSI_CREATE":"Generate VTSI File",
+        "STR_VTSI_CREATE_TIP":"This time will not write to the device, but only generate a VTSI file#@Continue?",
+        "STR_VTSI_CREATE_SUCCESS":"VTSI file created successfully!#@You can use Rufus(3.15+) to write it to the device so as to complete the installation of Ventoy.",
+        "STR_VTSI_CREATE_FAILED":"VTSI file created failed.",
         "STRXXX":""
     },
     {
         "STRXXX":""
     },
     {
         "STR_WEB_SERVICE_UNAVAILABLE":"Σφάλμα επικοινωνίας: υπηρεσία μη διαθέσιμη",
         "STR_WEB_TOKEN_MISMATCH":"Η κατάσταση του δαίμονα επικαιροποιήθηκε. Παρακαλώ δοκιμάστε αργότερα.",
         "STR_WEB_SERVICE_BUSY":"Η υπηρεσία είναι απασχολημένη. Παρακαλώ δοκιμάστε αργότερα.",
         "STR_WEB_SERVICE_UNAVAILABLE":"Σφάλμα επικοινωνίας: υπηρεσία μη διαθέσιμη",
         "STR_WEB_TOKEN_MISMATCH":"Η κατάσταση του δαίμονα επικαιροποιήθηκε. Παρακαλώ δοκιμάστε αργότερα.",
         "STR_WEB_SERVICE_BUSY":"Η υπηρεσία είναι απασχολημένη. Παρακαλώ δοκιμάστε αργότερα.",
+        "STR_MENU_VTSI_CREATE":"Generate VTSI File",
+        "STR_VTSI_CREATE_TIP":"This time will not write to the device, but only generate a VTSI file#@Continue?",
+        "STR_VTSI_CREATE_SUCCESS":"VTSI file created successfully!#@You can use Rufus(3.15+) to write it to the device so as to complete the installation of Ventoy.",
+        "STR_VTSI_CREATE_FAILED":"VTSI file created failed.",
         "STRXXX":""
     },
     {
         "STRXXX":""
     },
     {
         "STR_WEB_SERVICE_UNAVAILABLE":"Kommunikationsfel: Tjänsten är inte tillgänglig",
         "STR_WEB_TOKEN_MISMATCH":"Daemon-status uppdaterad. Försök igen senare.",
         "STR_WEB_SERVICE_BUSY":"Tjänster är upptagen. Försök igen senare.",
         "STR_WEB_SERVICE_UNAVAILABLE":"Kommunikationsfel: Tjänsten är inte tillgänglig",
         "STR_WEB_TOKEN_MISMATCH":"Daemon-status uppdaterad. Försök igen senare.",
         "STR_WEB_SERVICE_BUSY":"Tjänster är upptagen. Försök igen senare.",
+        "STR_MENU_VTSI_CREATE":"Generate VTSI File",
+        "STR_VTSI_CREATE_TIP":"This time will not write to the device, but only generate a VTSI file#@Continue?",
+        "STR_VTSI_CREATE_SUCCESS":"VTSI file created successfully!#@You can use Rufus(3.15+) to write it to the device so as to complete the installation of Ventoy.",
+        "STR_VTSI_CREATE_FAILED":"VTSI file created failed.",
         "STRXXX":""
     },
     {
         "STRXXX":""
     },
     {
         "STR_WEB_SERVICE_UNAVAILABLE":"Napaka v komunikaciji: storitev ni na voljo",
         "STR_WEB_TOKEN_MISMATCH":"Zahteva storitve je potekla, prosim poskusite kasneje.",
         "STR_WEB_SERVICE_BUSY":"Storitev je zasedena, prosim poskusite kasneje.",
         "STR_WEB_SERVICE_UNAVAILABLE":"Napaka v komunikaciji: storitev ni na voljo",
         "STR_WEB_TOKEN_MISMATCH":"Zahteva storitve je potekla, prosim poskusite kasneje.",
         "STR_WEB_SERVICE_BUSY":"Storitev je zasedena, prosim poskusite kasneje.",
+        "STR_MENU_VTSI_CREATE":"Generate VTSI File",
+        "STR_VTSI_CREATE_TIP":"This time will not write to the device, but only generate a VTSI file#@Continue?",
+        "STR_VTSI_CREATE_SUCCESS":"VTSI file created successfully!#@You can use Rufus(3.15+) to write it to the device so as to complete the installation of Ventoy.",
+        "STR_VTSI_CREATE_FAILED":"VTSI file created failed.",
         "STRXXX":""
     }
         "STRXXX":""
     }
-]
+]
\ No newline at end of file
index aa1f4c0feede0a1097ce671339c37e3e2a208232..ca2f0d7acdfaffa88ecec471042158f89cd31808 100644 (file)
@@ -72,6 +72,11 @@ typedef enum STR_ID
     STR_WEB_TOKEN_MISMATCH, //37\r
     STR_WEB_SERVICE_BUSY, //38\r
 \r
     STR_WEB_TOKEN_MISMATCH, //37\r
     STR_WEB_SERVICE_BUSY, //38\r
 \r
+    STR_MENU_VTSI_CREATE, //39\r
+    STR_VTSI_CREATE_TIP, //40\r
+    STR_VTSI_CREATE_SUCCESS, //41\r
+    STR_VTSI_CREATE_FAILED, //42\r
+\r
        STR_ID_MAX\r
 }STR_ID;\r
 \r
        STR_ID_MAX\r
 }STR_ID;\r
 \r
@@ -83,7 +88,8 @@ extern BOOL g_SecureBoot;
 #define VTOY_MENU_PART_STYLE      0xA003\r
 #define VTOY_MENU_PART_MBR        0xA004\r
 #define VTOY_MENU_PART_GPT        0xA005\r
 #define VTOY_MENU_PART_STYLE      0xA003\r
 #define VTOY_MENU_PART_MBR        0xA004\r
 #define VTOY_MENU_PART_GPT        0xA005\r
-#define VTOY_MENU_ALL_DEV        0xA006\r
+#define VTOY_MENU_ALL_DEV         0xA006\r
+#define VTOY_MENU_VTSI            0xA007\r
 \r
 \r
 typedef enum OPT_SUBMENU\r
 \r
 \r
 typedef enum OPT_SUBMENU\r
@@ -93,6 +99,7 @@ typedef enum OPT_SUBMENU
     OPT_SUBMENU_PART_CFG,\r
     OPT_SUBMENU_CLEAR,\r
     OPT_SUBMENU_ALL_DEV,\r
     OPT_SUBMENU_PART_CFG,\r
     OPT_SUBMENU_CLEAR,\r
     OPT_SUBMENU_ALL_DEV,\r
+    OPT_SUBMENU_VTSI,\r
 \r
     OPT_SUBMENU_MAX\r
 }OPT_SUBMENU;\r
 \r
     OPT_SUBMENU_MAX\r
 }OPT_SUBMENU;\r
index 768169330d5a9b357523ba698b3741c1f15d6017..d888b583a0449ab2354cdaf025de6fb18511df4d 100644 (file)
@@ -1268,7 +1268,6 @@ static int FormatPart1exFAT(UINT64 DiskSizeBytes)
 {\r
     MKFS_PARM Option;\r
     FRESULT Ret;\r
 {\r
     MKFS_PARM Option;\r
     FRESULT Ret;\r
-    FATFS fs;\r
 \r
     Option.fmt = FM_EXFAT;\r
     Option.n_fat = 1;\r
 \r
     Option.fmt = FM_EXFAT;\r
     Option.n_fat = 1;\r
@@ -1289,28 +1288,10 @@ static int FormatPart1exFAT(UINT64 DiskSizeBytes)
     Log("Formatting Part1 exFAT ...");\r
 \r
     Ret = f_mkfs(TEXT("0:"), &Option, 0, 8 * 1024 * 1024);\r
     Log("Formatting Part1 exFAT ...");\r
 \r
     Ret = f_mkfs(TEXT("0:"), &Option, 0, 8 * 1024 * 1024);\r
-\r
     if (FR_OK == Ret)\r
     {\r
         Log("Formatting Part1 exFAT success");\r
     if (FR_OK == Ret)\r
     {\r
         Log("Formatting Part1 exFAT success");\r
-\r
-        Ret = f_mount(&fs, TEXT("0:"), 1);\r
-        Log("mount part %d", Ret);\r
-\r
-        if (FR_OK == Ret)\r
-        {\r
-            Ret = f_setlabel(TEXT("Ventoy"));\r
-            Log("f_setlabel %d", Ret);\r
-\r
-            Ret = f_mount(0, TEXT("0:"), 1);\r
-            Log("umount part %d", Ret);\r
-            return 0;\r
-        }\r
-        else\r
-        {\r
-            Log("mount exfat failed %d", Ret);\r
-            return 1;\r
-        }\r
+        return 0;\r
     }\r
     else\r
     {\r
     }\r
     else\r
     {\r
@@ -1556,6 +1537,225 @@ End:
     return rc;\r
 }\r
 \r
     return rc;\r
 }\r
 \r
+int InstallVentoy2FileImage(PHY_DRIVE_INFO *pPhyDrive, int PartStyle)\r
+{\r
+    int i;\r
+    int rc = 1;\r
+    int Len = 0;\r
+    int dataLen = 0;\r
+    UINT size = 0;\r
+    UINT segnum = 0;\r
+    UINT32 chksum = 0;\r
+    UINT64 data_offset = 0;\r
+    UINT64 Part2StartSector = 0;\r
+    UINT64 Part1StartSector = 0;\r
+    UINT64 Part1SectorCount = 0;\r
+    UINT8 *pData = NULL;    \r
+    UINT8 *pBkGptPartTbl = NULL;\r
+    BYTE *ImgBuf = NULL;\r
+    MBR_HEAD *pMBR = NULL;\r
+    VTSI_FOOTER *pImgFooter = NULL;\r
+    VTSI_SEGMENT *pSegment = NULL;\r
+    VTOY_GPT_INFO *pGptInfo = NULL;\r
+    VTOY_GPT_HDR *pBkGptHdr = NULL;\r
+    FILE *fp = NULL;\r
+\r
+    Log("InstallVentoy2FileImage %s PhyDrive%d <<%s %s %dGB>>",\r
+        PartStyle ? "GPT" : "MBR", pPhyDrive->PhyDrive, pPhyDrive->VendorId, pPhyDrive->ProductId,\r
+        GetHumanReadableGBSize(pPhyDrive->SizeInBytes));\r
+\r
+    PROGRESS_BAR_SET_POS(PT_LOCK_FOR_CLEAN);\r
+\r
+    size = SIZE_1MB + VENTOY_EFI_PART_SIZE + 33 * 512 + VTSI_IMG_MAX_SEG * sizeof(VTSI_SEGMENT) + sizeof(VTSI_FOOTER);\r
+\r
+    pData = (UINT8 *)malloc(size);\r
+    if (!pData)\r
+    {\r
+        Log("malloc image buffer failed %d.", size);\r
+        goto End;\r
+    }\r
+\r
+    pImgFooter = (VTSI_FOOTER *)(pData + size - sizeof(VTSI_FOOTER));\r
+    pSegment = (VTSI_SEGMENT *)((UINT8 *)pImgFooter - VTSI_IMG_MAX_SEG * sizeof(VTSI_SEGMENT));\r
+    memset(pImgFooter, 0, sizeof(VTSI_FOOTER));\r
+    memset(pSegment, 0, VTSI_IMG_MAX_SEG * sizeof(VTSI_SEGMENT));\r
+\r
+    PROGRESS_BAR_SET_POS(PT_WRITE_VENTOY_START);\r
+\r
+    Log("Writing Boot Image ............................. ");\r
+    if (ReadWholeFileToBuf(VENTOY_FILE_STG1_IMG, 0, (void **)&ImgBuf, &Len))\r
+    {\r
+        Log("Failed to read stage1 img");\r
+        goto End;\r
+    }\r
+\r
+    unxz(ImgBuf, Len, NULL, NULL, pData, &dataLen, unxz_error);\r
+    SAFE_FREE(ImgBuf);\r
+\r
+    if (PartStyle)\r
+    {\r
+        pGptInfo = (VTOY_GPT_INFO *)pData;\r
+        memset(pGptInfo, 0, sizeof(VTOY_GPT_INFO));\r
+        VentoyFillGpt(pPhyDrive->SizeInBytes, pGptInfo);\r
+\r
+        pBkGptPartTbl = pData + SIZE_1MB + VENTOY_EFI_PART_SIZE;\r
+        memset(pBkGptPartTbl, 0, 33 * 512);\r
+\r
+        memcpy(pBkGptPartTbl, pGptInfo->PartTbl, 32 * 512);\r
+        pBkGptHdr = (VTOY_GPT_HDR *)(pBkGptPartTbl + 32 * 512);\r
+        VentoyFillBackupGptHead(pGptInfo, pBkGptHdr);\r
+\r
+        Part1StartSector = pGptInfo->PartTbl[0].StartLBA;\r
+        Part1SectorCount = pGptInfo->PartTbl[0].LastLBA - Part1StartSector + 1;\r
+        Part2StartSector = pGptInfo->PartTbl[1].StartLBA;\r
+\r
+        Log("Write GPT Info OK ...");\r
+    }\r
+    else\r
+    {\r
+        pMBR = (MBR_HEAD *)pData;\r
+        VentoyFillMBR(pPhyDrive->SizeInBytes, pMBR, PartStyle);\r
+        Part1StartSector = pMBR->PartTbl[0].StartSectorId;\r
+        Part1SectorCount = pMBR->PartTbl[0].SectorCount;\r
+        Part2StartSector = pMBR->PartTbl[1].StartSectorId;\r
+\r
+        Log("Write MBR OK ...");\r
+    }\r
+\r
+    Log("Writing EFI part Image ............................. ");\r
+    rc = ReadWholeFileToBuf(VENTOY_FILE_DISK_IMG, 0, (void **)&ImgBuf, &Len);\r
+    if (rc)\r
+    {\r
+        Log("Failed to read img file %p %u", ImgBuf, Len);\r
+        goto End;\r
+    }\r
+\r
+    PROGRESS_BAR_SET_POS(PT_WRITE_VENTOY_START + 28);\r
+    memset(g_part_img_buf, 0, sizeof(g_part_img_buf));\r
+    unxz(ImgBuf, Len, NULL, NULL, pData + SIZE_1MB, &dataLen, unxz_error);\r
+    if (dataLen == Len)\r
+    {\r
+        Log("decompress finished success");\r
+        g_part_img_buf[0] = pData + SIZE_1MB;\r
+\r
+        VentoyProcSecureBoot(g_SecureBoot);\r
+    }\r
+    else\r
+    {\r
+        Log("decompress finished failed");\r
+        goto End;\r
+    }\r
+\r
+    fopen_s(&fp, "VentoySparseImg.vtsi", "wb+");\r
+    if (!fp)\r
+    {\r
+        Log("Failed to create Ventoy img file");\r
+        goto End;\r
+    }\r
+\r
+    Log("Writing stage1 data ............................. ");\r
+    fwrite(pData, 1, SIZE_1MB, fp);\r
+    pSegment[0].disk_start_sector = 0;\r
+    pSegment[0].sector_num = SIZE_1MB / 512;\r
+    pSegment[0].data_offset = data_offset;\r
+    data_offset += pSegment[0].sector_num * 512;\r
+\r
+    disk_io_set_param(INVALID_HANDLE_VALUE, Part1StartSector + Part1SectorCount);// include the 2048 sector gap\r
+    disk_io_set_imghook(fp, pSegment + 1, VTSI_IMG_MAX_SEG - 1, data_offset);\r
+\r
+    Log("Formatting part1 exFAT ...");\r
+    if (0 != FormatPart1exFAT(pPhyDrive->SizeInBytes))\r
+    {\r
+        Log("FormatPart1exFAT failed.");\r
+        disk_io_reset_imghook(&segnum, &data_offset);\r
+        goto End;\r
+    }\r
+\r
+    disk_io_reset_imghook(&segnum, &data_offset);\r
+    segnum++;\r
+\r
+    Log("current segment number:%d dataoff:%ld", segnum, (long)data_offset);\r
+\r
+    //write data\r
+    Log("Writing part2 data ............................. ");\r
+    fwrite(pData + SIZE_1MB, 1, VENTOY_EFI_PART_SIZE, fp);\r
+    pSegment[segnum].disk_start_sector = Part2StartSector;\r
+    pSegment[segnum].sector_num = VENTOY_EFI_PART_SIZE / 512;\r
+    pSegment[segnum].data_offset = data_offset;\r
+    data_offset += pSegment[segnum].sector_num * 512;\r
+    segnum++;\r
+\r
+    if (PartStyle)\r
+    {\r
+        Log("Writing backup gpt table ............................. ");\r
+        fwrite(pBkGptPartTbl, 1, 33 * 512, fp);\r
+        pSegment[segnum].disk_start_sector = pPhyDrive->SizeInBytes / 512 - 33;\r
+        pSegment[segnum].sector_num = 33;\r
+        pSegment[segnum].data_offset = data_offset;\r
+        data_offset += pSegment[segnum].sector_num * 512;\r
+        segnum++;\r
+    }\r
+\r
+    Log("Writing segment metadata ............................. ");\r
+\r
+    for (i = 0; i < (int)segnum; i++)\r
+    {\r
+        Log("SEG[%d]:  PhySector:%llu SectorNum:%llu DataOffset:%llu(sector:%llu)", i, pSegment[i].disk_start_sector, pSegment[i].sector_num,\r
+            pSegment[i].data_offset, pSegment[i].data_offset / 512);\r
+    }\r
+\r
+    dataLen = segnum * sizeof(VTSI_SEGMENT);\r
+    fwrite(pSegment, 1, dataLen, fp);\r
+\r
+    if (dataLen % 512)\r
+    {\r
+        //pData + SIZE_1MB - 8192 is a temp data buffer with zero\r
+        fwrite(pData + SIZE_1MB - 8192, 1, 512 - (dataLen % 512), fp);\r
+    }\r
+\r
+    //Fill footer\r
+    pImgFooter->magic = VTSI_IMG_MAGIC;\r
+    pImgFooter->version = 1;\r
+    pImgFooter->disk_size = pPhyDrive->SizeInBytes;\r
+    memcpy(&pImgFooter->disk_signature, pPhyDrive->MBR.BootCode + 0x1b8, 4);\r
+    pImgFooter->segment_num = segnum;\r
+    pImgFooter->segment_offset = data_offset;\r
+\r
+    for (i = 0, chksum = 0; i < (int)(segnum * sizeof(VTSI_SEGMENT)); i++)\r
+    {\r
+        chksum += *((UINT8 *)pSegment + i);\r
+    }\r
+    pImgFooter->segment_chksum = ~chksum;\r
+\r
+    for (i = 0, chksum = 0; i < sizeof(VTSI_FOOTER); i++)\r
+    {\r
+        chksum += *((UINT8 *)pImgFooter + i);\r
+    }\r
+    pImgFooter->foot_chksum = ~chksum;\r
+\r
+    Log("Writing footer segnum(%u)  segoffset(%llu) ......................", segnum, data_offset);\r
+    Log("disk_size=%llu disk_signature=%lx segment_offset=%llu", pImgFooter->disk_size, pImgFooter->disk_signature, pImgFooter->segment_offset);\r
+\r
+    fwrite(pImgFooter, 1, sizeof(VTSI_FOOTER), fp);\r
+    fclose(fp);\r
+\r
+    Log("Writing Ventoy image file finished, the file size should be %llu .", data_offset + 512 + ((dataLen + 511) / 512 * 512));\r
+\r
+    rc = 0;\r
+\r
+End:\r
+\r
+    PROGRESS_BAR_SET_POS(PT_MOUNT_VOLUME);\r
+\r
+    Log("retcode:%d\n", rc);\r
+\r
+    SAFE_FREE(pData);\r
+    SAFE_FREE(ImgBuf);\r
+    \r
+    return rc;\r
+}\r
+\r
+\r
 int InstallVentoy2PhyDrive(PHY_DRIVE_INFO *pPhyDrive, int PartStyle)\r
 {\r
     int i;\r
 int InstallVentoy2PhyDrive(PHY_DRIVE_INFO *pPhyDrive, int PartStyle)\r
 {\r
     int i;\r
@@ -1573,7 +1773,6 @@ int InstallVentoy2PhyDrive(PHY_DRIVE_INFO *pPhyDrive, int PartStyle)
     UINT64 Part1SectorCount = 0;\r
     UINT64 Part2StartSector = 0;\r
 \r
     UINT64 Part1SectorCount = 0;\r
     UINT64 Part2StartSector = 0;\r
 \r
-\r
     Log("InstallVentoy2PhyDrive %s PhyDrive%d <<%s %s %dGB>>",\r
         PartStyle ? "GPT" : "MBR", pPhyDrive->PhyDrive, pPhyDrive->VendorId, pPhyDrive->ProductId,\r
         GetHumanReadableGBSize(pPhyDrive->SizeInBytes));\r
     Log("InstallVentoy2PhyDrive %s PhyDrive%d <<%s %s %dGB>>",\r
         PartStyle ? "GPT" : "MBR", pPhyDrive->PhyDrive, pPhyDrive->VendorId, pPhyDrive->ProductId,\r
         GetHumanReadableGBSize(pPhyDrive->SizeInBytes));\r
@@ -1680,8 +1879,6 @@ int InstallVentoy2PhyDrive(PHY_DRIVE_INFO *pPhyDrive, int PartStyle)
         goto End;\r
     }\r
 \r
         goto End;\r
     }\r
 \r
-    \r
-\r
     PROGRESS_BAR_SET_POS(PT_FORMAT_PART2);\r
     Log("Writing part2 FAT img ...");\r
     \r
     PROGRESS_BAR_SET_POS(PT_FORMAT_PART2);\r
     Log("Writing part2 FAT img ...");\r
     \r
index 4c9fdf4d1a32f7e7d3b663b377dff55a609497e4..9eb257015f9813ec7ff654c192681b3f5763c35e 100644 (file)
@@ -28,6 +28,7 @@ DWORD g_PhyDriveCount = 0;
 static int g_FilterRemovable = 0;\r
 int g_FilterUSB = 1;\r
 int g_ForceOperation = 1;\r
 static int g_FilterRemovable = 0;\r
 int g_FilterUSB = 1;\r
 int g_ForceOperation = 1;\r
+int g_WriteImage = 0;\r
 \r
 int ParseCmdLineOption(LPSTR lpCmdLine)\r
 {\r
 \r
 int ParseCmdLineOption(LPSTR lpCmdLine)\r
 {\r
index 8ec38ab8b1cb34c6d60697224b457ba25279c784..2f9b6918fa0afbfd1deff0e93f24a5e0cc3d4787 100644 (file)
@@ -233,4 +233,61 @@ UINT32 VentoyCrc32(void *Buffer, UINT32 Length);
 \r
 #define SECURE_ICON_STRING _UICON(UNICODE_LOCK)\r
 \r
 \r
 #define SECURE_ICON_STRING _UICON(UNICODE_LOCK)\r
 \r
+extern int g_WriteImage;\r
+\r
+#define VTSI_IMG_MAGIC 0x0000594F544E4556ULL  // "VENTOY\0\0"\r
+\r
+#pragma pack(1)\r
+\r
+/*\r
+ +---------------------------------\r
+ + sector 0 ~ sector N-1\r
+ +     data area\r
+ +---------------------------------\r
+ + sector N ~ \r
+ +     segment[0]\r
+ +     segment[1]\r
+ +     segment[2]\r
+ +      ......\r
+ +     segment[M-1]\r
+ +     align data (aligned with 512)\r
+ +---------------------------------\r
+ +     footer\r
+ +---------------------------------\r
+ *\r
+ * All the integers are in little endian\r
+ * The sector size is fixed 512 for ventoy image file.\r
+ *\r
+ */\r
+\r
+#define VTSI_IMG_MAX_SEG   128\r
+\r
+typedef struct {\r
+    UINT64 disk_start_sector;\r
+    UINT64 sector_num;\r
+    UINT64 data_offset;\r
+}VTSI_SEGMENT;\r
+\r
+typedef struct {\r
+    UINT64 magic;\r
+    UINT32 version;\r
+    UINT64 disk_size;\r
+    UINT32 disk_signature;\r
+    UINT32 foot_chksum;\r
+\r
+    UINT32 segment_num;\r
+    UINT32 segment_chksum;\r
+    UINT64 segment_offset;\r
+\r
+    UINT8  reserved[512 - 44];\r
+}VTSI_FOOTER;\r
+#pragma pack()\r
+extern int __static_assert__[sizeof(VTSI_FOOTER) == 512 ? 1 : -1];\r
+\r
+\r
+#define SAFE_FREE(ptr) if (ptr) { free(ptr); (ptr) = NULL; }\r
+int InstallVentoy2FileImage(PHY_DRIVE_INFO *pPhyDrive, int PartStyle);\r
+void disk_io_set_imghook(FILE *fp, VTSI_SEGMENT *segment, int maxseg, UINT64 data_offset);\r
+void disk_io_reset_imghook(int *psegnum, UINT64 *pDataOffset);\r
+\r
 #endif\r
 #endif\r
index 20f6f66c0473aa1f9286e86b5789348057646fcb..a91de0c2d76cd05ca1f90367feefe053680e68cf 100644 (file)
Binary files a/Ventoy2Disk/Ventoy2Disk/WinDialog.c and b/Ventoy2Disk/Ventoy2Disk/WinDialog.c differ
index bebe6253c8491e937f4b8dd426975ea21a6562c3..d62b581c5b9c64a89c8c2ce8832db60eeff9ba8d 100644 (file)
@@ -11,6 +11,8 @@
 
 #include "ff.h"                        /* Obtains integer types */
 #include "diskio.h"            /* Declarations of disk functions */
 
 #include "ff.h"                        /* Obtains integer types */
 #include "diskio.h"            /* Declarations of disk functions */
+#include "../Ventoy2Disk.h"
+
 
 /* Definitions of physical drive number for each drive */
 #define DEV_RAM                0       /* Example: Map Ramdisk to physical drive 0 */
 
 /* Definitions of physical drive number for each drive */
 #define DEV_RAM                0       /* Example: Map Ramdisk to physical drive 0 */
@@ -23,12 +25,41 @@ static UINT8 g_MbrSector[512];
 HANDLE g_hPhyDrive;
 UINT64 g_SectorCount;
 
 HANDLE g_hPhyDrive;
 UINT64 g_SectorCount;
 
+FILE *g_VentoyImgFp = NULL;
+VTSI_SEGMENT *g_VentoySegment = NULL;
+int g_VentoyMaxSeg = 0;
+int g_VentoyCurSeg = -1;
+UINT64 g_VentoyDataOffset = 0;
+
 void disk_io_set_param(HANDLE Handle, UINT64 SectorCount)
 {
     g_hPhyDrive = Handle;
     g_SectorCount = SectorCount;
 }
 
 void disk_io_set_param(HANDLE Handle, UINT64 SectorCount)
 {
     g_hPhyDrive = Handle;
     g_SectorCount = SectorCount;
 }
 
+void disk_io_set_imghook(FILE *fp, VTSI_SEGMENT *segment, int maxseg, UINT64 data_offset)
+{
+    g_VentoyImgFp = fp;
+    g_VentoySegment = segment;
+    g_VentoyMaxSeg = maxseg;
+
+    memset(segment, 0, maxseg * sizeof(VTSI_SEGMENT));
+    g_VentoyCurSeg = -1;
+    g_VentoyDataOffset = data_offset;
+}
+
+void disk_io_reset_imghook(int *psegnum, UINT64 *pDataOffset)
+{
+    *psegnum = g_VentoyCurSeg + 1;
+    *pDataOffset = g_VentoyDataOffset;
+
+    g_VentoyImgFp = NULL;
+    g_VentoySegment = NULL;
+    g_VentoyMaxSeg = 0;
+    g_VentoyCurSeg = -1;
+    g_VentoyDataOffset = 0;
+}
+
 /*-----------------------------------------------------------------------*/
 /* Get Drive Status                                                      */
 /*-----------------------------------------------------------------------*/
 /*-----------------------------------------------------------------------*/
 /* Get Drive Status                                                      */
 /*-----------------------------------------------------------------------*/
@@ -126,6 +157,13 @@ DRESULT disk_read (
     BOOL bRet;
     LARGE_INTEGER liCurrentPosition;
 
     BOOL bRet;
     LARGE_INTEGER liCurrentPosition;
 
+    //Log("xxx disk_read: sector:%ld count:%ld", (long)sector, (long)count);
+
+    if (g_VentoyImgFp)
+    {
+        return RES_OK;
+    }
+
     liCurrentPosition.QuadPart = sector * 512;
     SetFilePointerEx(g_hPhyDrive, liCurrentPosition, &liCurrentPosition, FILE_BEGIN);
 
     liCurrentPosition.QuadPart = sector * 512;
     SetFilePointerEx(g_hPhyDrive, liCurrentPosition, &liCurrentPosition, FILE_BEGIN);
 
@@ -162,6 +200,9 @@ DRESULT disk_write (
     DWORD dwSize;
     BOOL bRet;
     LARGE_INTEGER liCurrentPosition;
     DWORD dwSize;
     BOOL bRet;
     LARGE_INTEGER liCurrentPosition;
+    VTSI_SEGMENT *CurSeg = NULL;
+
+    Log("==== disk_write: sector:%ld count:%ld", (long)sector, (long)count);
 
     // skip MBR
     if (sector == 0)
 
     // skip MBR
     if (sector == 0)
@@ -177,6 +218,31 @@ DRESULT disk_write (
         count--;
     }
 
         count--;
     }
 
+    if (g_VentoyImgFp)
+    {
+        CurSeg = g_VentoySegment + g_VentoyCurSeg;
+
+        if (g_VentoyCurSeg >= 0 && CurSeg->sector_num > 0 && sector == CurSeg->disk_start_sector + CurSeg->sector_num)
+        {
+            CurSeg->sector_num += count; //merge
+        }
+        else
+        {
+            g_VentoyCurSeg++;
+            CurSeg++;
+
+            CurSeg->disk_start_sector = sector;
+            CurSeg->data_offset = g_VentoyDataOffset;
+            CurSeg->sector_num = count;
+        }
+
+        g_VentoyDataOffset += count * 512;
+
+        fwrite(buff, 1, count * 512, g_VentoyImgFp);
+        return RES_OK;
+    }
+
+
     liCurrentPosition.QuadPart = sector * 512;
     SetFilePointerEx(g_hPhyDrive, liCurrentPosition, &liCurrentPosition, FILE_BEGIN);
 
     liCurrentPosition.QuadPart = sector * 512;
     SetFilePointerEx(g_hPhyDrive, liCurrentPosition, &liCurrentPosition, FILE_BEGIN);
 
index c39bea6f26f47566de138c9b52583b30439aefed..5fb4823b26c30e0f669e34fe98a5e170445a47eb 100644 (file)
@@ -6067,6 +6067,11 @@ FRESULT f_mkfs (
                /* Initialize the root directory */
                mem_set(buf, 0, sz_buf * ss);
                buf[SZDIRE * 0 + 0] = ET_VLABEL;                                        /* Volume label entry (no label) */
                /* Initialize the root directory */
                mem_set(buf, 0, sz_buf * ss);
                buf[SZDIRE * 0 + 0] = ET_VLABEL;                                        /* Volume label entry (no label) */
+
+        //default label: Ventoy (unicode)
+        buf[1] = 6; //label length
+        memcpy(buf + 2, L"Ventoy", 2 * buf[1]);
+
                buf[SZDIRE * 1 + 0] = ET_BITMAP;                                        /* Bitmap entry */
                st_dword(buf + SZDIRE * 1 + 20, 2);                                     /*  cluster */
                st_dword(buf + SZDIRE * 1 + 24, szb_bit);                       /*  size */
                buf[SZDIRE * 1 + 0] = ET_BITMAP;                                        /* Bitmap entry */
                st_dword(buf + SZDIRE * 1 + 20, 2);                                     /*  cluster */
                st_dword(buf + SZDIRE * 1 + 24, szb_bit);                       /*  size */