byhabit Posted August 22, 2013 Share Posted August 22, 2013 arkadaşlar elimde üç adet exe dosyası var var windows xp için xp.exe win7 x86 için win7.exe win7 x64 için win7x64.exe isimlerinde üç adet dosya bunları işletim sistemini algılayıp sistem türüne göre çalıştırabilirmiyim ve hangi dosyayı kurduğunu kurulum bitince bilgi mesajı olarak veridirebilirmiyim. amacım hepsini tek bir exe yapmak Quote Link to comment Share on other sites More sharing options...
reyiz Posted August 22, 2013 Share Posted August 22, 2013 Örnek proje: https://app.box.com/s/5fweq2dxd92ptybkdmgs Quote Link to comment Share on other sites More sharing options...
byhabit Posted August 22, 2013 Author Share Posted August 22, 2013 (edited) Örnek proje: https://app.box.com/s/5fweq2dxd92ptybkdmgs ben beceremedim herhalde dosyayı çalıştıramıyorum ve ayrıca xp için ayrı nasıl yaparım xp.exe de win7 de çalışmayan ayarlar var dosya yolunu bu şekilde yazdım. os = System.GetOSName(); if not System.Is64BitOS() then arch = "x86" result = File.Install("AutoPlay\\Docs\\win7x86.exe", FILE_INSTALL_SAMEOLDER, false, false, nil, nil); else arch = "x64" result = File.Install("AutoPlay\\Docs\\win7x64.exe", FILE_INSTALL_SAMEOLDER, false, false, nil, nil); end Edited August 22, 2013 by byhabit Quote Link to comment Share on other sites More sharing options...
HalilYanar Posted August 22, 2013 Share Posted August 22, 2013 (edited) Butona falan ekliceksen ; On Click : [codeh] tBit = Folder.DoesExist("C:\\Program Files (x86)"); os = System.GetOSName(); if os == "Windows XP" then File.Run(_SourceFolder.."xp.exe", "", "", SW_SHOWNORMAL, false); elseif os == "Windows 7" then File.Run(_SourceFolder.."win7.exe", "", "", SW_SHOWNORMAL, false); elseif os == "Windows 7" and tBit then File.Run(_SourceFolder.."win7x64.exe", "", "", SW_SHOWNORMAL, false); else Dialog.Message("HATA", "Sistem Bilgisi Alınamadı !"); end [/codeh] Bu arada _SourceFolder çalıştırılan programının bulunduğu dosya. Benim aklıma bu geliyor umarım doğrudur. Edited August 22, 2013 by HalilYanar Quote Link to comment Share on other sites More sharing options...
reyiz Posted August 22, 2013 Share Posted August 22, 2013 (edited) Sürücü harfi her sistemde aynı değildir. tBit = Folder.DoesExist("C:\\Program Files (x86)"); yerine tBit = Folder.DoesExist(_ProgramFilesFolder); kullanmak daha doğru olacaktır. System.GetOsName() fonksiyonu ile de işletim sisteminin 64 bit olup olmadığının kontrol edilebileceğini hatırlatayım. Edited August 22, 2013 by reyiz Quote Link to comment Share on other sites More sharing options...
byhabit Posted August 22, 2013 Author Share Posted August 22, 2013 Butona falan ekliceksen ; On Click : [codeh] tBit = Folder.DoesExist("C:\\Program Files (x86)"); os = System.GetOSName(); if os == "Windows XP" then File.Run(_SourceFolder.."xp.exe", "", "", SW_SHOWNORMAL, false); elseif os == "Windows 7" then File.Run(_SourceFolder.."win7.exe", "", "", SW_SHOWNORMAL, false); elseif os == "Windows 7" and tBit then File.Run(_SourceFolder.."win7x64.exe", "", "", SW_SHOWNORMAL, false); else Dialog.Message("HATA", "Sistem Bilgisi Alınamadı !"); end [/codeh] Bu arada _SourceFolder çalıştırılan programının bulunduğu dosya. Benim aklıma bu geliyor umarım doğrudur. üzgünüm dosyaları bundada açmadı SourceFolder den eminmisin? benim çok bilgim yok ams de ilk denemeler yani :) Quote Link to comment Share on other sites More sharing options...
reyiz Posted August 22, 2013 Share Posted August 22, 2013 (edited) Programların adının başına \\ ekleyin. File.Run(_SourceFolder.."win7.exe", "", "", SW_SHOWNORMAL, false); değil File.Run(_SourceFolder.."\\win7.exe", "", "", SW_SHOWNORMAL, false); Edited August 22, 2013 by reyiz Quote Link to comment Share on other sites More sharing options...
byhabit Posted August 22, 2013 Author Share Posted August 22, 2013 (edited) Programların adının başına \\ ekleyin. File.Run(_SourceFolder.."win7.exe", "", "", SW_SHOWNORMAL, false); değil File.Run(_SourceFolder.."\\win7.exe", "", "", SW_SHOWNORMAL, false); Hatanın nerde olduğunu anlamadım Buton'un OnClik evresine bu kodları yazdım ama dosyaların hiçbirini çalıştırmıyor tBit = Folder.DoesExist("C:\\Program Files (x86)"); os = System.GetOSName(); if os == "Windows XP" then File.Run(_SourceFolder.."\\xp.exe", "", "", SW_SHOWNORMAL, false); elseif os == "Windows 7" then File.Run(_SourceFolder.."\\win7.exe", "", "", SW_SHOWNORMAL, false); elseif os == "Windows 7" and tBit then result = File.Run(_SourceFolder.."\\win7x64.exe", "", "", SW_SHOWNORMAL, false); else Dialog.Message("HATA", "Sistem Bilgisi Alınamadı !"); end Edited August 22, 2013 by byhabit Quote Link to comment Share on other sites More sharing options...
DivaneTR Posted August 22, 2013 Share Posted August 22, 2013 Sürücü harfi her sistemde aynı değildir. tBit = Folder.DoesExist("C:\\Program Files (x86)"); yerine tBit = Folder.DoesExist(_ProgramFilesFolder); kullanmak daha doğru olacaktır. System.GetOsName() fonksiyonu ile de işletim sisteminin 64 bit olup olmadığının kontrol edilebileceğini hatırlatayım. _ProgramFilesFolder her bilgisayarda illaki bir klasöre denk geleceğinden hiçbir anlamı olmayacaktır. System.Is64BitOS() en sağlam yöntem olacaktır. Quote Link to comment Share on other sites More sharing options...
byhabit Posted August 22, 2013 Author Share Posted August 22, 2013 _ProgramFilesFolder her bilgisayarda illaki bir klasöre denk geleceğinden hiçbir anlamı olmayacaktır. System.Is64BitOS() en sağlam yöntem olacaktır. Bir örnek verebilirmisin? benim kullandığım sistem win7x64 butona tıklayınca ilgili dosyayı açmıyor Quote Link to comment Share on other sites More sharing options...
DivaneTR Posted August 22, 2013 Share Posted August 22, 2013 Şu anda bilgisayarda AMS yok. Ezbere yazıyorum, yanlışlıklar olabilir. os = System.GetOSName(); if os == "Windows XP" then File.Run(_SourceFolder.."\\XP.exe", "", "", SW_SHOWNORMAL, false); elseif os == "Windows 7" then If not System.Is64BitOS() then File.Run(_SourceFolder.."\\x86.exe", "", "", SW_SHOWNORMAL, false); else File.Run(_SourceFolder.."\\x64.exe", "", "", SW_SHOWNORMAL, false); end end Quote Link to comment Share on other sites More sharing options...
reyiz Posted August 22, 2013 Share Posted August 22, 2013 (edited) Denemeden kod yazmayın ki milletin kafası daha da karışmasın. Edited August 22, 2013 by reyiz Quote Link to comment Share on other sites More sharing options...
DivaneTR Posted August 22, 2013 Share Posted August 22, 2013 Gerekli açıklamayı yaptığım için gönlüm rahat, ve yine konuya atlayacağını doğru tahmin etmiş olduğum için keyfim de yerinde :H: Quote Link to comment Share on other sites More sharing options...
reyiz Posted August 22, 2013 Share Posted August 22, 2013 Kodu deneyip denemediğimi nereden biliyorsun. Denemiştim ve hata vermemişti. Bu yüzden açıklama yazmamıştım. Bana açıklama yapmadığım için değil, kodu denemediğim için kızmıştınız. Bu sizi haklı çıkarmıyor. Quote Link to comment Share on other sites More sharing options...
DivaneTR Posted August 22, 2013 Share Posted August 22, 2013 Seni haklı çıkarıyor mu ? :hım: Quote Link to comment Share on other sites More sharing options...
byhabit Posted August 22, 2013 Author Share Posted August 22, 2013 Şu anda bilgisayarda AMS yok. Ezbere yazıyorum, yanlışlıklar olabilir. os = System.GetOSName(); if os == "Windows XP" then File.Run(_SourceFolder.."\\XP.exe", "", "", SW_SHOWNORMAL, false); elseif os == "Windows 7" then If not System.Is64BitOS() then File.Run(_SourceFolder.."\\x86.exe", "", "", SW_SHOWNORMAL, false); else File.Run(_SourceFolder.."\\x64.exe", "", "", SW_SHOWNORMAL, false); end end bu hatayı veriyor. http://m1308.hizliresim.com/1d/r/rtjdk.jpg Quote Link to comment Share on other sites More sharing options...
DivaneTR Posted August 22, 2013 Share Posted August 22, 2013 If yerine küçük harflerle if yazmayı denermisiniz ? Quote Link to comment Share on other sites More sharing options...
reyiz Posted August 22, 2013 Share Posted August 22, 2013 Seni haklı çıkarıyor mu ? :hım: Kodların doğruluğunu kastediyorsanız yanılmış olabilirim. Ama söylediklerim konusunda haklı olduğumu düşünüyorum. Quote Link to comment Share on other sites More sharing options...
DivaneTR Posted August 22, 2013 Share Posted August 22, 2013 Aynen aynen, ben de öyle düşünüyorum :orly: Quote Link to comment Share on other sites More sharing options...
byhabit Posted August 22, 2013 Author Share Posted August 22, 2013 If yerine küçük harflerle if yazmayı denermisiniz ? denedim hata vermedi bu sefer ama doyaları açmıyor sorun bende sanırım ilgili exe'leri şu dizine atıyorum doğru değilmi? C:\Users\Aytek\Documents\AutoPlay Media Studio 8\Projects\Ayar\CD_Root\AutoPlay\Docs Quote Link to comment Share on other sites More sharing options...
DivaneTR Posted August 22, 2013 Share Posted August 22, 2013 Doğru değil, CD_Root klasörüne atacaksın. (autorun.exe dosyasının olduğu klasöre) Quote Link to comment Share on other sites More sharing options...
byhabit Posted August 22, 2013 Author Share Posted August 22, 2013 Doğru değil, CD_Root klasörüne atacaksın. (autorun.exe dosyasının olduğu klasöre) tamam oldu teşekkür ediyorum size eziyet ettim kusura bakmayın :) Quote Link to comment Share on other sites More sharing options...
byhabit Posted August 23, 2013 Author Share Posted August 23, 2013 Bir Sorum daha olucak buton'a eklediğim bu komutlarda çalıştırılan her bir exe'nin kurulumu bitince Dialog message ile işlem tamamlanmıştır mesajı verdirebilirmiyim. os = System.GetOSName(); if os == "Windows XP" then File.Run(_SourceFolder.."\\XP.exe", "", "", SW_SHOWNORMAL, false); elseif os == "Windows 7" then if not System.Is64BitOS() then File.Run(_SourceFolder.."\\x86.exe", "", "", SW_SHOWNORMAL, false); else File.Run(_SourceFolder.."\\x64.exe", "", "", SW_SHOWNORMAL, false); end end Quote Link to comment Share on other sites More sharing options...
nightmare3519 Posted August 23, 2013 Share Posted August 23, 2013 Her File.Run altında Dialog.Message yazmalısın. Quote Link to comment Share on other sites More sharing options...
byhabit Posted August 23, 2013 Author Share Posted August 23, 2013 Her File.Run altında Dialog.Message yazmalısın. yazdım her dosya çalışmaya başlar başlamaz hemen mesaj veriyor programın yüklenmesini beklemiyor. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.