File tree Expand file tree Collapse file tree 3 files changed +12
-3
lines changed Expand file tree Collapse file tree 3 files changed +12
-3
lines changed Original file line number Diff line number Diff line change 44
55-  Updated ` PrintToPDFOptions `  to also allow specifying the ` PageSize `  with an object (#769  )
66-  Updated splashscreen image to have 0 margin (#622  )
7+ -  Fixed single instance behavior using the ` ElectronSingleInstance `  property (#901  )
78-  Added option to use ` ElectronSplashScreen `  with an HTML file (#799  )
89-  Added option to provide floating point value as aspect ratios with ` SetAspectRatio `  (#793  )
910
Original file line number Diff line number Diff line change @@ -136,18 +136,26 @@ private BuildInfo GatherBuildInfo()
136136                buildInfo . ElectronExecutable  =  attributes . FirstOrDefault ( e =>  e . Key  ==  nameof ( buildInfo . ElectronExecutable ) ) ? . Value ; 
137137                buildInfo . ElectronVersion  =  attributes . FirstOrDefault ( e =>  e . Key  ==  nameof ( buildInfo . ElectronVersion ) ) ? . Value ; 
138138                buildInfo . RuntimeIdentifier  =  attributes . FirstOrDefault ( e =>  e . Key  ==  nameof ( buildInfo . RuntimeIdentifier ) ) ? . Value ; 
139-                 buildInfo . ElectronSingleInstance  =  attributes . FirstOrDefault ( e =>  e . Key  ==  nameof ( buildInfo . ElectronSingleInstance ) ) ? . Value ; 
140139                buildInfo . Title  =  attributes . FirstOrDefault ( e =>  e . Key  ==  nameof ( buildInfo . Title ) ) ? . Value ; 
141140                buildInfo . Version  =  attributes . FirstOrDefault ( e =>  e . Key  ==  nameof ( buildInfo . Version ) ) ? . Value ; 
142141                buildInfo . BuildConfiguration  =  attributes . FirstOrDefault ( e =>  e . Key  ==  nameof ( buildInfo . BuildConfiguration ) ) ? . Value ; 
143142                var  isAspNet  =  attributes . FirstOrDefault ( e =>  e . Key  ==  "IsAspNet" ) ? . Value ; 
143+                 var  isSingleInstance  =  attributes . FirstOrDefault ( e =>  e . Key  ==  nameof ( buildInfo . ElectronSingleInstance ) ) ? . Value ; 
144+                 var  httpPort  =  attributes . FirstOrDefault ( e =>  e . Key  ==  "AspNetHttpPort" ) ? . Value ; 
144145
145146                if  ( isAspNet ? . Length  >  0  &&  bool . TryParse ( isAspNet ,  out  var  res )  &&  res ) 
146147                { 
147148                    ElectronNetRuntime . DotnetAppType  =  DotnetAppType . AspNetCoreApp ; 
148149                } 
149150
150-                 var  httpPort  =  attributes . FirstOrDefault ( e =>  e . Key  ==  "AspNetHttpPort" ) ? . Value ; 
151+                 if  ( isSingleInstance ? . Length  >  0  &&  bool . TryParse ( isSingleInstance ,  out  var  res )  &&  res ) 
152+                 { 
153+                     buildInfo . ElectronSingleInstance  =  "yes" ; 
154+                 } 
155+                 else 
156+                 { 
157+                     buildInfo . ElectronSingleInstance  =  "no" ; 
158+                 } 
151159
152160                if  ( httpPort ? . Length  >  0  &&  int . TryParse ( httpPort ,  out  var  port ) ) 
153161                { 
Original file line number Diff line number Diff line change @@ -92,7 +92,7 @@ app.on('will-finish-launching', () => {
9292
9393const  manifestJsonFile  =  require ( manifestJsonFilePath ) ; 
9494
95- if  ( manifestJsonFile . singleInstance )  { 
95+ if  ( manifestJsonFile . singleInstance   ===   "yes" )  { 
9696    const  mainInstance  =  app . requestSingleInstanceLock ( ) ; 
9797    app . on ( 'second-instance' ,  ( events ,  args  =  [ ] )  =>  { 
9898        args . forEach ( ( parameter )  =>  { 
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments