0

I made an MSI installer using WIX. installing on windows 7 is no problem bud on windows 7 embedded something funny is going on. when the software is installed it does run, bud not properly. I found out it had something to do with administrator permissions. the executable doesn't start as administrator, which it should since only then it runs properly. I could set it manualy bud i prefer to do it automatically via the installer. Can this simple be done as described in this thread and put in a VB.NET script? or is there another better way?

note: the executable always needs to run as administrator, so the setting needs to be permanent.

thanks in advance. F.Jansen

Community
  • 1
  • 1
F.J
  • 35
  • 10

1 Answers1

0

Is this an executable that you have control over and also is this a VC++ executable ? If yes, I would suggest to re-compile this executable by making it UAC compliant. This would involve re-compiling the executable with the appropriate flags as stated at:

https://msdn.microsoft.com/en-us/library/bb384691.aspx

/MANIFESTUAC:level=_level

Set the value of _level variable to :requireAdministrator

Doing so would make the executable UAC compliant and then launch it always with Administrative privileges. This is the recommended way for all UAC compliant executables starting with Windows Vista or higher.

You can read more about UAC at: https://technet.microsoft.com/en-us/library/cc709628(v=ws.10).aspx

What you are trying to do as highlighted How to set "Run this program as an administrator" programmatically , exists just for the purpose of back ward compatibility. If the .exe that you are trying to launch is a legacy exe, then this might be the way to go. Make sure that if you follow this approach, it exists in the latest version of Windows.

Hope this helps.

Community
  • 1
  • 1
Kiran Hegde
  • 680
  • 4
  • 14
  • thanks for the reply, however I have no other choise than make it work by using the registry edit since I am unable to do anything aboud the .exe. however I got a little problem with the implementation of the "" and chr(34). this is what I have now: `code` Process.Start("cmd.exe", Chr(34) & "/k reg add HKLM\Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers" /v & Chr(34) & "C:\Program Files\MMI\MMI.exe" & Chr(34) & / t REG_SZ /d & Chr(34) & "RUNASADMIN" & Chr(34)) `code` however it does not accept this as there are some syntax errors. any idea how to solve this? thanks – F.J Aug 19 '15 at 14:08
  • Why dont you create this registry key as part of your installation package? That seems like the most logical thing to do here. You can make use of the Registry table in windows installer . Here is an example to acheive the same using Wix:http://wixtoolset.org/documentation/manual/v3/howtos/files_and_registry/write_a_registry_entry.html – Kiran Hegde Aug 20 '15 at 05:20