@@ -44,18 +44,19 @@ export class LinuxApplicationManager extends ApplicationManagerBase {
4444 } ) ;
4545 }
4646
47- /** `packageFilePath` is the executable in the build output. */
47+ /** `packageFilePath` is the executable (debug) or the `.tar.gz` (release) in the build output. */
4848 public async installApplication (
4949 packageFilePath : string ,
5050 appIdentifier ?: string ,
5151 _buildData ?: IBuildData ,
5252 ) : Promise < void > {
53- fs . chmodSync ( packageFilePath , 0o755 ) ;
54- this . _executables [ path . basename ( packageFilePath ) ] = packageFilePath ;
53+ const executable = LinuxApplicationManager . executableIn ( packageFilePath ) ;
54+ fs . chmodSync ( executable , 0o755 ) ;
55+ this . _executables [ path . basename ( executable ) ] = executable ;
5556 if ( appIdentifier ) {
56- this . _executables [ appIdentifier ] = packageFilePath ;
57+ this . _executables [ appIdentifier ] = executable ;
5758 try {
58- installDebugDesktopEntry ( path . dirname ( packageFilePath ) , appIdentifier ) ;
59+ installDebugDesktopEntry ( path . dirname ( executable ) , appIdentifier ) ;
5960 } catch ( e ) {
6061 this . $logger . warn (
6162 `Couldn't register ${ appIdentifier } with the desktop: ${ e ?. message ?? e } ` ,
@@ -64,6 +65,14 @@ export class LinuxApplicationManager extends ApplicationManagerBase {
6465 }
6566 }
6667
68+ /** Release archives are packed from the staged `<name>/<name>`. */
69+ private static executableIn ( packageFilePath : string ) : string {
70+ const archive = path . basename ( packageFilePath ) . match ( / ^ ( .+ ) \. t a r \. g z $ / ) ;
71+ return archive
72+ ? path . join ( path . dirname ( packageFilePath ) , archive [ 1 ] , archive [ 1 ] )
73+ : packageFilePath ;
74+ }
75+
6776 public async uninstallApplication ( appIdentifier : string ) : Promise < void > {
6877 delete this . _executables [ appIdentifier ] ;
6978 }
0 commit comments