Jump to content

Recommended Posts

Posted

Hello all,

 

This might well be a Windows 10 thing that has TOTALLY passed me by and if it has then this might be a daft question. But here I go all the same lol.

 

Back in the day, it used to be possible to knock up a batch file to run at startup that went something like:

 

if not exist "%systemdrive%\Program Files\aprogram\theprogram.exe" msiexec /i \\mydomain\someshareoranother\setup.exe /qn

 

And that'd look for some obscure little component of your desired program and if it wasn't there install it. You could also force a reinstall of your program by deleting that little executable (or whatever file it looks for) and then it'd dutifully reinstall on a workstation at eg startup.

 

Trying this on W10 (I think for the first time) and it won't reinstall the application when restarted. It seems to need it to be uninstalled from the add/remove programs bit.

 

Is this "a thing" now and have I just completely missed it?

 

Thanks everyone!

Posted

I think the "delete marker file to cause reinstallation" behaviour you mention was never guaranteed. It will work on some applications, not on others, depending on the installer logic.

 

You are calling an executable with that script, rather than calling an MSI. You'd be more likely to get "repair" behaviour if you called the MSI directly.

 

If it were me though, I'd always / have always called the uninstaller first, then run a clean install.

  • Thanks 1
Posted

I've just tried this and It's working fine for the 3 applications I've tried it for, which are IrFanView, Lego WeDo and Google FileStream.

 

 

We're deploying them like this...

 

net use b: \\SOMESERVER\SOMESHARE\applications\GoogleDriveStream

if NOT exist "C:\Program Files\Google\Drive File Stream\launch.bat" b:\GoogleDriveSetup.exe --silent --desktop_shortcut

net use B: /delete 

 

If I delete the if NOT exist condition, the installer runs again and overwrites, the file timestamps change.

 

I suspect, the MSI behaves differently and I would be managing MSIs through GPO or via Application Package.

  • Thanks 1
Posted

Thanks muchly all! Just wandering back in.

 

If you log in as a different user is the file you deleted still gone? What user is the script running as?

Yep still gone. It's there as a startup script.

 

But thanks all for the hints. Lots to explore but also reassured the principle still works.

 

The specific .msi has enough issues when we doubleclick the thing so we're now doing some to-and-fro with their support on it.

 

Cheers much though all and happy Fridays.

Posted
winget install Google.Drive

winget install IrfanSkiljan.IrfanView

 

Stupid question, but does that take into the account the whole "only if not already installed" thing, such that that command can sit in a startup script indefinitely?

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...