@@ -83,7 +83,7 @@ describe("resolveWinInstallIdentity", () => {
8383 expect ( source ) . not . toContain ( '"DisplayName" "${productName} \\${APP_VERSION}"' ) ;
8484 } ) ;
8585
86- it ( "registers the invite protocol and removes it on uninstall only while this install owns it" , async ( ) => {
86+ it ( "removes an Electron-refreshed invite protocol while this install still owns it" , async ( ) => {
8787 const source = await readFile ( new URL ( "../src/win/custom-installer.ts" , import . meta. url ) , "utf8" ) ;
8888 expect ( source ) . toContain ( 'const inviteProtocolKey = "Software\\\\Classes\\\\opendesign"' ) ;
8989 expect ( source ) . toContain ( 'WriteRegStr HKCU "${inviteProtocolKey}" "URL Protocol" ""' ) ;
@@ -94,12 +94,16 @@ describe("resolveWinInstallIdentity", () => {
9494 expect ( source ) . toContain (
9595 'ReadRegStr $0 HKCU "${inviteProtocolKey}\\\\shell\\\\open\\\\command" ""' ,
9696 ) ;
97- expect ( source ) . toContain (
97+ expect ( source ) . toContain ( "StrCpy $1 '$\\\"$INSTDIR\\\\${exeName}$\\\"'" ) ;
98+ expect ( source ) . toContain ( "StrLen $2 $1" ) ;
99+ expect ( source ) . toContain ( "StrCpy $3 $0 $2" ) ;
100+ expect ( source ) . toContain ( "StrCmp $3 $1 0 preserve_invite_protocol" ) ;
101+ expect ( source ) . not . toContain (
98102 "StrCmp $0 '$\\\"$INSTDIR\\\\${exeName}$\\\" $\\\"%1$\\\"' 0 preserve_invite_protocol" ,
99103 ) ;
100104 expect ( source ) . toContain ( 'DeleteRegKey HKCU "${inviteProtocolKey}"' ) ;
101105 expect ( source ) . toContain ( "preserve_invite_protocol:" ) ;
102- expect ( source . indexOf ( "StrCmp $0 " ) ) . toBeLessThan (
106+ expect ( source . indexOf ( "StrCmp $3 $1 " ) ) . toBeLessThan (
103107 source . indexOf ( 'DeleteRegKey HKCU "${inviteProtocolKey}"' ) ,
104108 ) ;
105109 expect ( source . indexOf ( 'DeleteRegKey HKCU "${inviteProtocolKey}"' ) ) . toBeLessThan (
0 commit comments