JRA Posted March 31, 2022 Posted March 31, 2022 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!
mavhc Posted March 31, 2022 Posted March 31, 2022 If you log in as a different user is the file you deleted still gone? What user is the script running as? 1
DavR Posted March 31, 2022 Posted March 31, 2022 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. 1
mavhc Posted March 31, 2022 Posted March 31, 2022 use wmic to find out if a product is already installed https://superuser.com/questions/938109/is-there-an-efficient-way-to-query-if-product-is-installed-on-windows-and-retrie But if it's an MSI just use GPO 1
Oaktech Posted March 31, 2022 Posted March 31, 2022 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. 1
mavhc Posted April 1, 2022 Posted April 1, 2022 winget install Google.Drive winget install IrfanSkiljan.IrfanView 2
JRA Posted April 1, 2022 Author Posted April 1, 2022 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.
jthompson Posted April 1, 2022 Posted April 1, 2022 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?
mavhc Posted April 3, 2022 Posted April 3, 2022 if it's already at the latest version I don't think anything will happen
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now