This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- Re: Delete property from MSI file
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Oct 23, 2008
12:46 PM
Delete property from MSI file
Hi,
I have one "simple" 😄 question, why it doesn't work (install script):
nr_res = MsiOpenDatabase("C:\MyProg.msi", MSIDBOPEN_DIRECT, hDatabase);
if(nr_res == ERROR_SUCCESS) then
ok = TRUE;
endif;
nr_res = MsiDatabaseOpenView(hDatabase, "DELETE FROM Property WHERE Property = 'MyProperty'", hView);
if(nr_res == ERROR_SUCCESS) then
ok = TRUE;
endif;
nr_res = MsiViewExecute(hView, NULL);
if(nr_res == ERROR_SUCCESS) then
ok = TRUE;
endif;
nr_res = MsiViewExecute(hView, 0);
if(nr_res == ERROR_SUCCESS) then
ok = TRUE;
endif;
nr_res = MsiViewClose(hView);
if(nr_res == ERROR_SUCCESS) then
ok = TRUE;
endif;
nr_res = MsiDatabaseCommit(hDatabase);
if(nr_res == ERROR_SUCCESS) then
ok = TRUE;
endif;
After execute msi file still got property "MyProperty". It is possilbe to delete property (or Action from InstallExecuteSequence) from MSI file using Install Script????
😄
I have one "simple" 😄 question, why it doesn't work (install script):
nr_res = MsiOpenDatabase("C:\MyProg.msi", MSIDBOPEN_DIRECT, hDatabase);
if(nr_res == ERROR_SUCCESS) then
ok = TRUE;
endif;
nr_res = MsiDatabaseOpenView(hDatabase, "DELETE FROM Property WHERE Property = 'MyProperty'", hView);
if(nr_res == ERROR_SUCCESS) then
ok = TRUE;
endif;
nr_res = MsiViewExecute(hView, NULL);
if(nr_res == ERROR_SUCCESS) then
ok = TRUE;
endif;
nr_res = MsiViewExecute(hView, 0);
if(nr_res == ERROR_SUCCESS) then
ok = TRUE;
endif;
nr_res = MsiViewClose(hView);
if(nr_res == ERROR_SUCCESS) then
ok = TRUE;
endif;
nr_res = MsiDatabaseCommit(hDatabase);
if(nr_res == ERROR_SUCCESS) then
ok = TRUE;
endif;
After execute msi file still got property "MyProperty". It is possilbe to delete property (or Action from InstallExecuteSequence) from MSI file using Install Script????
😄
(4) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Oct 23, 2008
06:00 PM
Some quick questions and impressions:
You'll want a double backslash in the InstallScript string (as you would in C): "C:\\filename.msi".
Do any of the functions return a nonzero value?
Does changing the SQL query to this make any difference:
DELETE FROM `Property` WHERE `Property`.`Property`='MyProperty'
...?
There seem to be two identical calls to MsiViewExecute; perhaps there should be a call to MsiViewFetch and MsiViewModify?
You'll want a double backslash in the InstallScript string (as you would in C): "C:\\filename.msi".
Do any of the functions return a nonzero value?
Does changing the SQL query to this make any difference:
DELETE FROM `Property` WHERE `Property`.`Property`='MyProperty'
...?
There seem to be two identical calls to MsiViewExecute; perhaps there should be a call to MsiViewFetch and MsiViewModify?
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Oct 24, 2008
02:59 AM
Hi,
nr_res = MsiOpenDatabase("C:\\MyProg.msi", MSIDBOPEN_DIRECT, hDatabase);
if(nr_res == ERROR_SUCCESS) then
MessageBox("OK",1 );
endif;
nr_res = MsiDatabaseOpenView(hDatabase, "DELETE FROM Property WHERE Property = 'MyProperty'", hView);
if(nr_res == ERROR_SUCCESS) then
MessageBox("OK",1 );
endif;
nr_res = MsiViewExecute(hView, NULL);
if(nr_res == ERROR_SUCCESS) then
MessageBox("OK",1 );
endif;
nr_res = MsiViewClose(hView);
if(nr_res == ERROR_SUCCESS) then
MessageBox("OK",1 );
endif;
nr_res = MsiDatabaseCommit(hDatabase);
if(nr_res == ERROR_SUCCESS) then
MessageBox("OK",1 );
endif;
I've go five times message "OK", so command seems to bee ok. I try to change SQL query "DELETE FROM `Property` WHERE `Property`.`Property`='MyProperty'" but it wolden help. Does anyone have some sugestions??
P.S.
For example in Perl everythings works fine.
P.S. 2
In LogFile is something like this (RemoveProperty is CustomAction name):
MSI (c) (F0!9C) [10:01:11:053]: Leaked MSIHANDLE (34) of type 790540 for thread 1948
Action ended 10:01:11: RemoveProperty. Return value 1.
nr_res = MsiOpenDatabase("C:\\MyProg.msi", MSIDBOPEN_DIRECT, hDatabase);
if(nr_res == ERROR_SUCCESS) then
MessageBox("OK",1 );
endif;
nr_res = MsiDatabaseOpenView(hDatabase, "DELETE FROM Property WHERE Property = 'MyProperty'", hView);
if(nr_res == ERROR_SUCCESS) then
MessageBox("OK",1 );
endif;
nr_res = MsiViewExecute(hView, NULL);
if(nr_res == ERROR_SUCCESS) then
MessageBox("OK",1 );
endif;
nr_res = MsiViewClose(hView);
if(nr_res == ERROR_SUCCESS) then
MessageBox("OK",1 );
endif;
nr_res = MsiDatabaseCommit(hDatabase);
if(nr_res == ERROR_SUCCESS) then
MessageBox("OK",1 );
endif;
I've go five times message "OK", so command seems to bee ok. I try to change SQL query "DELETE FROM `Property` WHERE `Property`.`Property`='MyProperty'" but it wolden help. Does anyone have some sugestions??
P.S.
For example in Perl everythings works fine.
P.S. 2
In LogFile is something like this (RemoveProperty is CustomAction name):
MSI (c) (F0!9C) [10:01:11:053]: Leaked MSIHANDLE (34) of type 790540 for thread 1948
Action ended 10:01:11: RemoveProperty. Return value 1.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Oct 24, 2008
09:17 AM
Is this code in an MSI project? The MSI help says that MsiDatabaseCommit can't be called from a custom action, so perhaps that has a bearing on the issue?
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Oct 24, 2008
12:28 PM
Why use an InstallScript custom action for this instead of a set property custom action?
If you use a set property custom action you can simply say MyProperty = {} and that will delete the property. It is far simpler, unless of course you are trying to modify an existing MSI package on the user's machine?
Also, the DELETE command will not work on the currently running database if memory serves me correctly, however, I cannot find the documentation to backup this memory. 🙂
If you use a set property custom action you can simply say MyProperty = {} and that will delete the property. It is far simpler, unless of course you are trying to modify an existing MSI package on the user's machine?
Also, the DELETE command will not work on the currently running database if memory serves me correctly, however, I cannot find the documentation to backup this memory. 🙂
![](/skins/images/3B39CE851FDD5528C393F146EB70A2D0/responsive_peak/images/icon_anonymous_message.png)