Win API: GetCommandLine
-
And another problem that has me completely floored: In a Windows Installer DLL, it is necessary for me to get and adjust the commandline, write it into RunOnce and reboot the machine. I've never used GetCommandLine before because I've always had access to the WinMain arguments, so it has never been necessary but in this case there is no other way to access it. On Windows 9X, I have no problem. I use
_tcscpy( szRunOnce, GetCommandLine() );
and szRunOnce is populated with"C:\WINDOWS\SYSTEM\msiexec.exe" /i "E:\MyFolder\MyInstaller.msi" /l*v C:\msilog.txt
. That's exactly what I expect. On Windows 2000, I get something else entirely - something like:C:\WINNT\System32\MsiExec.exe -Embedding 03E11881F81557A4CAAAA7C7B6ADDFBB
This is no use to me whatsoever, as far as I can see. Is this Windows Installer doing this to me or GetCommandLine? If the latter then is there a good way of building the string that I'm really looking for? Paul