First - Office version. I want to check for the presence of any Office 2013 or 365 application, not just Word or Excel specifically. I was planning to do this through checking for the value ProductVersion at HKLM\SOFTWARE\Microsoft\Office\15.0\Common\ or HKLM\SOFTWARE\Wow6432Node\Microsoft\Office\15.0\Common\
However, according to this technet thread, it seems that the issue isn't quite that simple once you throw 365 into the mix. They suggest that the best way to detect the presence of Office is through the progIDs (Excel.Application.15, Word.Application.15, etc). Given that, would it be sufficient to search for the keys HKLM\Software\Classes\Excel.Application.15 OR HKLM\Software\Classes\Word.Application.15 OR HKLM\Software\Classes\Powerpoint.Application.15 to meet my criteria (both 2013 and 365 seem to use the version 15) or is there a better way to go about this?
Secondly, checking for the connected account within Office. This part is relatively simple - I believe I just have to search for the value ConnectedAccountCID at HKCU\Software\Microsoft\Office\15.0\Common\Identity and verify that it is not NULL. However, if it is NULL, I don't want the installer to fail - just return a message saying that the user will have to log into an account within office before the modifications will take effect. Is this possible?
Lastly, I need to determine the Dropbox install location, and then keep that string so I can write a custom registry value later. By default, Dropbox installs to %HOMEPATH%\Dropbox, but this can be customized. The location is actually stored in an base64 encrypted file at %APPDATA%\Dropbox\host.db in the second line. From stackoverflow and a dropbox dev there is a lovely piece of C# that extracts this information, but I'm unsure of how I can integrate this. The code is:
Code: Select all
private static string GetDropBoxPath()
{
var appDataPath = Environment.GetFolderPath(
Environment.SpecialFolder.ApplicationData);
var dbPath = Path.Combine(appDataPath, "Dropbox\\host.db");
if (!File.Exists(dbPath))
return null;
var lines = File.ReadAllLines(dbPath);
var dbBase64Text = Convert.FromBase64String(lines[1]);
var folderPath = System.Text.Encoding.UTF8.GetString(dbBase64Text);
return folderPath;
}Hopefully this can be done - I've only ever done web programming, and don't really have the knowledge to write and compile my own installer executable (even though it's only making a few registry changes!) The whole thing can otherwise be run through a bat file (and has been up to this point), but I'd really like to streamline it and make things dummy proof.
Cheers,
-Philip
FOLLOW US
Get the latest news in Application Packaging