Changes

Google drive

1,514 bytes added, 12:41, 4 June 2015
Google Drive Enterprise
</pre>
'''XML template file'''Note. The 'Remove' line uses a script I use to work out the MSI uninstall command and then run it. As the command changes for each version of Google Drive a different way of working out the uninstall command is needed. Another piece of Autoit code below the template can be compiled as a command line exe. This will print the msi code, this can then be put into the template file as something like this:
<source lang="xml">
</packages>
</source>
 
'''MSI Uninstall command'''
 
<pre>
#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Outfile=msi_productid.exe
#AutoIt3Wrapper_UseX64=n
#AutoIt3Wrapper_Change2CUI=y
#AutoIt3Wrapper_Res_Fileversion=0.0.0.7
#AutoIt3Wrapper_Res_Fileversion_AutoIncrement=y
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
#include <Clipboard.au3>
$cmd_only = 0
 
If ($Cmdline[0] > 0) And (StringInStr($cmdline[1], "?") = 0) Then
$msi_file = $cmdline[1]
$cmd_only = 1
Else
$msi_file = FileOpenDialog("Select the MSI file to find its Product Code", EnvGet("SYSTEMDRIVE"), "MSI File (*.msi)", 1 + 2, "")
If @error Then
MsgBox(4096, "", "No File(s) chosen")
Exit
EndIf
EndIf
 
$a = DllCall("msi.dll", "uint", "MsiOpenPackage", "str", $msi_file, "int*", 0)
$b = DllCall("msi.dll", "uint", "MsiGetProductProperty", "int", $a[2], "str", "ProductCode", "str", "", "dword*", 126)
 
DllCall("msi.dll", "uint", "MsiCloseHandle", "int", $a[2])
_ClipBoard_SetData($b[3])
ConsoleWrite($b[3])
If $cmd_only = 0 Then MsgBox(4096, "", $b[3] & @CRLF & @CRLF & "(copied to clipboard)")
</pre>
[[Category:Silent Installers]]
15
edits