Hi all,
I have been struggling with this for a while without success.
I need to deploy an access application and moving awayfrom the Ms Access Package Wizard.
To be able to create the shortcut target with the right path, I need to check which version of access is installed.
I set up a launch condition on Windows Installer Search for both Access 2003 and 2007.
I then created a custom action on Install to retrieve the path using:
/Access2003="[ACCESS2003]\" /Access2007="[ACCESS2007]\" /TargetDir="[TARGETDIR]\"
I also have the installer class with the setup project.
When I run it on a client with Access 2003 only, it will fail with:
Error 1001. Exception occurred while initializing the installatio: System.ArgumentException...
If the parameter is used as an installer option, the format must be /key=[value]
If I removed the Access2007 bit, the installation run successfully. Same thing will happen on a client running access 2007. I need to remove the /Access2003="[ACCESS2003]\" bit for the installation to work
It seems that if the search returns false and the path is empty the installation will fail
In the installer class I tried to ensure that the parameter exists before using it. If I understand the help properly, the property is not created if the value is not found.
const string Access2003 = "Access2003";
const string Access2007 = "Access2007";
if (Context.Parameters.ContainsKey(Access2003))
Access2003_Path = Context.Parameters[Access2003];
if (Context.Parameters.ContainsKey(Access2007))
Access2007_Path = Context.Parameters[Access2007];
Any help will be greatly appreciated, as I run out of ideas as to make it work if a version is not found
Benwa
I have been struggling with this for a while without success.
I need to deploy an access application and moving awayfrom the Ms Access Package Wizard.
To be able to create the shortcut target with the right path, I need to check which version of access is installed.
I set up a launch condition on Windows Installer Search for both Access 2003 and 2007.
I then created a custom action on Install to retrieve the path using:
/Access2003="[ACCESS2003]\" /Access2007="[ACCESS2007]\" /TargetDir="[TARGETDIR]\"
I also have the installer class with the setup project.
When I run it on a client with Access 2003 only, it will fail with:
Error 1001. Exception occurred while initializing the installatio: System.ArgumentException...
If the parameter is used as an installer option, the format must be /key=[value]
If I removed the Access2007 bit, the installation run successfully. Same thing will happen on a client running access 2007. I need to remove the /Access2003="[ACCESS2003]\" bit for the installation to work
It seems that if the search returns false and the path is empty the installation will fail
In the installer class I tried to ensure that the parameter exists before using it. If I understand the help properly, the property is not created if the value is not found.
const string Access2003 = "Access2003";
const string Access2007 = "Access2007";
if (Context.Parameters.ContainsKey(Access2003))
Access2003_Path = Context.Parameters[Access2003];
if (Context.Parameters.ContainsKey(Access2007))
Access2007_Path = Context.Parameters[Access2007];
Any help will be greatly appreciated, as I run out of ideas as to make it work if a version is not found
Benwa