Jun 26, 2014
03:58 PM
I've been customizing an XAML template to build my InstallScript project, but I have a major problem that I cannot figure out for the life of me: I need to take build parameters from TFS and pass them to my InstallScript project. For example, I have a preprocessor define called DATA_YEAR and a TFS parameter called DataYear. Is there any way to pass that parameter value to the preprocessor define? I need to do the same with path variables too. I have a SLN file and ISPROJ file, and I can build just fine if I set the preprocessor defines in the release definition, and use the existing values for path variables.
... View more
Labels
- Labels:
-
InstallShield 2013
Jun 04, 2013
04:06 PM
The installation I need write requires a rather complex UI sequence (custom dialogs & many different UI paths). I've seen how tedious MSI's internal UI can be, so I'm thinking about using an InstallScript MSI project. I know the language very well, but I attended an InstallShield training class earlier this year and the instructor discouraged us from using InstallScript MSI projects. They wouldn't elaborate much except to say that it was like "the bastard child of MSI and InstallScript; primarily created to support very old installation projects." Is there any major reason NOT to use this project type? Has anyone had to start over or convert their projects to InstallScript or Basic MSI due to limitations or bugs with InstallScript MSI projects? I'm very interested in hearing any recommendations. Thanks! PS - There is one thing I can't find any information on: The help file says the InstallScript engine ultimately calls MsiInstallProduct with arguments based upon "installation mode, internal feature selections, and current property values." Is there any way to determine/log the actual arguments passed to MsiInstallProduct?
... View more
Labels
- Labels:
-
InstallShield 2011
Apr 22, 2013
09:10 AM
Thanks for you patience; I'm obviously misunderstanding something fundamental. My concern is this: if I use version lying/always overwrite in this release the file will get overwritten, but won't the file version in the cached MSi be 65535.0.0.0? If this is the case, won't that prevent the file from ever getting overwritten again?
... View more
Apr 21, 2013
07:44 PM
Thank you for your reply. My code showed almost every return code in a message box; they all returned ERROR_SUCCESS. Calling each Msi function that uses a buffer like this: nBuffer = MAX_PATH; sDir = ""; if (MsiGetProperty(hInstall, "INSTALLDIR", sDir, nBuffer) == ERROR_MORE_DATA) then nBuffer++; MsiGetProperty(hInstall, "INSTALLDIR", sDir, nBuffer); endif; or this: nBuffer = 65535; sDir = ""; MsiGetProperty(hInstall, "INSTALLDIR", sDir, nBuffer); made no difference. I should have reinitialized the buffer before each call, but that still does not make any difference. In my original post I stated that my action was not deferred. Also, this is not the code that will be used in my installation; this is merely a test project.
... View more
Apr 21, 2013
03:02 PM
I've been spending my entire weekend trying to find a way around having to use the "Always Overwrite" option in my basic MSI project. I have two 3rd party EXEs in my project and the manufacturer has downgraded the version number in the current release. I don't want to use Version Lying because that will cause issues during the next release. What I've been trying to do is copy the cached MSI from the previous release to a different location (which I have done successfully), downgrade the file versions in it, then put it back. However none of my SQL queries are executing properly! The API functions all return 0 (success), but the file version isn't updated. Not only that, but my SELECT statements to check the update only return blank values. I have tested both my queries in the MSI query tool and they both perform the actions I want. So why won't it work in my custom action!? Here is the code. It runs in immediate mode after FindRelatedProducts under the condition 'IS_MAJOR_UPGRADE' OLDVERSIONINSTALLED is set by a major upgrade item. function DowngradeFileVersions(hInstall) NUMBER nBuffer; STRING sCachedMsi, sPatchedMsi, sSQL, sGuid, sDir, sValue; HWND hDB, hView, hRec; begin nBuffer = 65535; MsiGetProperty(hInstall, "OLDVERSIONINSTALLED", sGuid, nBuffer); nBuffer = 65535; MsiGetProductInfo(sGuid, INSTALLPROPERTY_LOCALPACKAGE, sCachedMsi, nBuffer); nBuffer = 65535; MsiGetProperty(hInstall, "INSTALLDIR", sDir, nBuffer); sPatchedMsi = sDir ^ "Patched.msi"; DeleteFile(sPatchedMsi); CopyFile(sCachedMsi, sPatchedMsi); SprintfBox(MB_OK, "MsiOpenDatabase", "%ld", MsiOpenDatabase(sPatchedMsi, MSIDBOPEN_TRANSACT, hDB)); // check version sSQL = "SELECT `File`.`Version` FROM `File` WHERE `File`.`FileName` = 'CRA.exe' AND `File`.`Component_` = 'cra.exe'"; SprintfBox(MB_OK, "MsiDatabaseOpenView", "%ld", MsiDatabaseOpenView(hDB, sSQL, hView)); hRec = MsiCreateRecord(1); SprintfBox(MB_OK, "MsiViewExecute", "%ld", MsiViewExecute(hView, hRec)); nBuffer = 65535; SprintfBox(MB_OK, "MsiRecordGetString", "%ld", MsiRecordGetString(hRec, 1, sValue, nBuffer)); MessageBox(sValue, INFORMATION); MsiViewClose(hView); MsiCloseHandle(hView); MsiCloseHandle(hRec); // update version sSQL = "UPDATE `File` SET `File`.`Version` = '0.0.0.0' WHERE `File`.`FileName` = 'CRA.exe' AND `File`.`Component_` = 'cra.exe'"; SprintfBox(MB_OK, "MsiDatabaseOpenView", "%ld", MsiDatabaseOpenView(hDB, sSQL, hView)); SprintfBox(MB_OK, "MsiViewExecute", "%ld", MsiViewExecute(hView, NULL)); SprintfBox(MB_OK, "MsiDatabaseCommit", "%ld", MsiDatabaseCommit(hDB)); MsiViewClose(hView); MsiCloseHandle(hView); // check version again sSQL = "SELECT `File`.`Version` FROM `File` WHERE `File`.`FileName` = 'CRA.exe' AND `File`.`Component_` = 'cra.exe'"; SprintfBox(MB_OK, "MsiDatabaseOpenView", "%ld", MsiDatabaseOpenView(hDB, sSQL, hView)); hRec = MsiCreateRecord(1); SprintfBox(MB_OK, "MsiViewExecute", "%ld", MsiViewExecute(hView, hRec)); nBuffer = 65535; SprintfBox(MB_OK, "MsiRecordGetString", "%ld", MsiRecordGetString(hRec, 1, sValue, nBuffer)); MessageBox(sValue, INFORMATION); MsiViewClose(hView); MsiCloseHandle(hView); MsiCloseHandle(hRec); // clean up MsiCloseHandle(hDB); DeleteFile(sCachedMsi); CopyFile(sPatchedMsi, sCachedMsi); return ERROR_SUCCESS; end;
... View more
Labels
- Labels:
-
InstallShield 2011
Mar 25, 2013
11:46 AM
I need to populate a very large SQL table (268,000+ rows & 200+ columns) in a Basic MSI project, and I plan on using BULK INSERT for this. That's no problem, but the only thing I'm not sure of is where to put the flat file in the project. I don't have a lot of MSI experience, so I'm not sure if putting this file in a component is the best way to go. The bottom line is that I don't want the flat file left on the user's system after the installation completes, and I don't want to have to deal with Windows Installer's annoying file protection. I just want to insert the data and get rid of the file.
... View more
- Tags:
- msi
- sql server
Labels
- Labels:
-
InstallShield 2011
Latest posts by seth_at_work
Subject | Views | Posted |
---|---|---|
6503 | Jun 26, 2014 03:58 PM | |
1361 | Jun 04, 2013 04:06 PM | |
943 | Apr 22, 2013 09:10 AM | |
943 | Apr 21, 2013 07:44 PM | |
2140 | Apr 21, 2013 03:02 PM | |
2994 | Mar 25, 2013 11:46 AM |
Activity Feed
- Posted Passing TFS build parameters to InstallScript project on InstallShield Forum. Jun 26, 2014 03:58 PM
- Posted Looking for info/opinions on InstallScript MSI projects on InstallShield Forum. Jun 04, 2013 04:06 PM
- Posted Re: Cannot get SQL queries to run!!! on InstallShield Forum. Apr 22, 2013 09:10 AM
- Posted Re: Cannot get SQL queries to run!!! on InstallShield Forum. Apr 21, 2013 07:44 PM
- Posted Cannot get SQL queries to run!!! on InstallShield Forum. Apr 21, 2013 03:02 PM
- Posted Where to put data files for BULK INSERT in Basic MSI project on InstallShield Forum. Mar 25, 2013 11:46 AM
- Tagged Where to put data files for BULK INSERT in Basic MSI project on InstallShield Forum. Mar 25, 2013 11:46 AM
- Tagged Where to put data files for BULK INSERT in Basic MSI project on InstallShield Forum. Mar 25, 2013 11:46 AM