# General information: # https://support.microsoft.com/fr-fr/help/818418/command-line-options-for-installing-microsoft-technet-products ## Make sure you are on 64 bit powershell. Quit otherwise with warning if ([IntPtr]::size -eq 8){ Write-Host "64-bit powershell. Continue running" } else { Write-Host "You are not running a 64-bit powershell. Some functions will not work. Please restart this script." Exit } ## -0- Setup Directories # Create temp directory $workdir = "C:\temp" New-Item -Path $workdir -Type Directory -Force cd $workdir # Copy all files from Communs to tmp file Get-ChildItem -Path "Q:\NIMBE\LCMCE\Logiciels" -Exclude _* | Get-ChildItem -Recurse | Where-Object {$_.Extension -Match "zip|exe|msi|iso"} | Copy-Item -Destination $workdir # Install and setup 7zip & "${workdir}\7z1900-x64.exe" /S $7zip = "C:\Program Files\7-Zip\7z.exe" ## -1- Administration # 1.1 Setup SyncToy # Mount Windows 10 Iso file $WindowsDiskImage = Mount-DiskImage -ImagePath ${workdir}\Windows10_1809.iso -PassThru $WindowsDriveLetter = ($WindowsDiskImage | Get-Volume).DriveLetter # Install .Net Frameworks 2.0 and 3.5 Dism.exe /online /enable-feature /featurename:NetFX3 /All /Source:${WindowsDriveLetter}:\sources\sxs # Dismount Windows Image Disk Dismount-DiskImage -ImagePath ${workdir}\Windows10_1809.iso # Install SyncToy # Extract SyncToy package & $7zip x "${workdir}\SyncToySetupPackage_v21_x64.exe" -oSyncToy # Run according to installation instructions from Windows Start-Process '.\SyncToy\Microsoft Sync Framework\Synchronization-v2.0-x64-ENU.msi' -ArgumentList /passive -Wait Start-Process '.\SyncToy\Microsoft Sync Framework Services\ProviderServices-v2.0-x64-ENU.msi' -ArgumentList /passive -Wait Start-Process '.\SyncToy\SyncToySetup.msi' -ArgumentList /passive -Wait # 1.2 Set Admin-local Password $Password = ConvertTo-SecureString "DSM-Saclay" -AsPlainText -Force $UserAccount = Get-LocalUser -Name "Admin-local" $UserAccount | Set-LocalUser -Password $Password # 1.3 Create LCMCE-local Account $LocalPassword = ConvertTo-SecureString "CO2Reduction" -AsPlainText -Force New-LocalUser "LCMCE-local" -Password $LocalPassword -FullName "LCMCE - local" -Description "Compte local LCMCE - E Nicolas (EN247018)." ## -2- Install programs for General Chemistry # 2.1 Topspin 4.0 # See topspin install pdf at https://www.bruker.com/fileadmin/user_upload/8-PDF-Docs/MagneticResonance/Service_NMR/Installation-Guides/install_topspin_40.pdf # Extract topspin Package & $7zip x "${workdir}\topspin-4.0.9-windows.exe" -oTopSpin # Install CodeMeter Start-Process "${workdir}\CodeMeterRuntime64.exe" -ArgumentList /i -Wait # Start the actual install & "${workdir}\TopSpin\install-topspin-4.0.9.tmp\install.cmd" -a -s topspin --nmrsu $env:ComputerName\Admin-local --nmradminpw "bruker" # 2.2 Chemdraw # Perform silent install # http://informatics.perkinelmer.com/Support/KnowledgeBase/details/Default?TechNote=3412 # Extract with 7-zip & $7zip x "${workdir}\cos19.1.exe" -oChemdraw # Install ChemOffice Start-Process "${workdir}\Chemdraw\PerkinElmer\ChemOffice\PerkinElmer_ChemOffice_Suite_2019.msi" -ArgumentList /qb -Wait # 2.3 CSD Suite & $7zip x ${workdir}\csds-2020.0.1-windows.zip -oCSD # TODO: Use Start-Process -Wait Start-Process ${workdir}\CSD\csds-2020.0.1-windows\csds-windows.exe -ArgumentList "--mode unattended --unattendedmodeui none --Licensing ActivateAfterInstall --activation_key CC3EDD-B1852C-4AB6A4-B37A74-6BF51E-70ABE7" -Wait ## -3- Computational Chemistry # 3.1 Chemcraft # Extract zip file & $7zip x "${workdir}\Chemcraft_b562b_win64.zip" -oChemcraft # Copy it to a proper location $ChemcraftPath="C:\Tools\Chemcraft" New-Item -Path $ChemcraftPath -Type Directory -Force Copy-Item -Path "${workdir}\Chemcraft" -Destination C:\Tools -Recurse -Force # Tell the user to set permissions Start-Process explorer.exe -ArgumentList $ChemcraftPath -Wait $wshell = New-Object -ComObject Wscript.Shell $wshell.Popup("Set the permissions for the Chemcraft folder",0,"Permissions for Chemcraft",0x30 + 0x0) # 3.2 Gaussian and Gaussview # Extract & $7zip x Gaussian.zip -oGaussian Start Notepad++ ${workdir}\Gaussian\Serial.txt Start-Process ${workdir}\Gaussian\G09-D1-64bit\setup.exe -Wait Start-Process ${workdir}\Gaussian\GV6\SETUP.EXE -Wait # 3.3 Bitvise SSH Client Start-Process ${workdir}\BvSshClient-Inst.exe -ArgumentList -acceptEULA -Wait # 3.4 CYLView Start-Process ${workdir}\CYLview_BETA_build561.exe -Wait # 3.5 Geac & ${workdir}\Geac-setup-win64.exe /S # -4- Utilities # 4.1 Notepad++ Start-Process "${workdir}\npp.7.8.7.Installer.x64.exe" -ArgumentList /S -Wait # 4.2 Pdf SaM Start-Process -Wait "${workdir}\pdfsam-4.1.3.msi" -ArgumentList "/qb /norestart CHECK_FOR_UPDATES=true DONATE_NOTIFICATION=false SKIPTHANKSPAGE=Yes" # 4.3 Keepass Start-Process ${workdir}\KeePass-2.45-Setup.exe /SILENT -Wait # 4.4 OwnCloud for MyCore Start-Process -Wait msiexec -ArgumentList "/passive /i ${workdir}\ownCloud-2.6.1.13407.13049.msi REBOOT=ReallySuppress"