@@ -234,13 +234,10 @@ async function aptInstallOM(
234234 * @param bit String specifying 32 or 64 bit version.
235235 */
236236async function winInstallOM ( version : VersionType , bit : string ) : Promise < void > {
237- // Download OpenModelica installer to RUNNER_TEMP to avoid workspace cleanup issues on Windows.
238- // RUNNER_TEMP is automatically cleaned up by the runner after the job completes.
239- const runnerTemp = process . env [ 'RUNNER_TEMP' ] ?? os . tmpdir ( )
240- const tmpDir = path . join ( runnerTemp , 'setup-openmodelica' )
237+ // Download OpenModelica installer to tmp/
241238 const installer = await util . downloadCachedSync (
242239 version . address ,
243- tmpDir ,
240+ 'tmp' ,
244241 version . version === 'nightly'
245242 )
246243
@@ -269,11 +266,12 @@ async function winInstallOM(version: VersionType, bit: string): Promise<void> {
269266 path . join ( 'C:\\Program Files\\' , openmodelicahome [ 0 ] )
270267 )
271268
272- // Clean up. RUNNER_TEMP is automatically cleaned after the job, so failures are non-fatal.
269+ // Clean up. Failures are non-fatal: Windows may briefly lock the installer file
270+ // after execution (e.g. antivirus scan), so we warn rather than fail the action.
273271 try {
274- fs . rmSync ( tmpDir , { recursive : true , force : true , maxRetries : 10 } )
272+ fs . rmSync ( 'tmp' , { recursive : true , force : true , maxRetries : 10 } )
275273 } catch ( err ) {
276- core . warning ( `Failed to remove installer temp directory ${ tmpDir } : ${ err } ` )
274+ core . warning ( `Failed to remove installer temp directory: ${ err } ` )
277275 }
278276}
279277
0 commit comments